title: How to pass id(Parameter ) from one place to another in same page?
body: <p>I am new to angular 2/4 projects. in this interface I get a popup search tab with editable list.</p>
  
  <p>But I am not aware of the method to get data to main interface for edit after I click this list edit button.</p>
  
  <p>Simply what I need is to pass the id of the current item to main edit view as a parameter.</p>
  
  <p><strong>My code:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/eIhtl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eIhtl.png" alt="enter image description here"></a></p>
  
  <p><strong>This is my TS file:</strong></p>
  
  <pre><code> Editmodeclose(value: any) {
   { 
       let ItemID: number =this._activatedRoute.snapshot.params['code'];
  
       alert(this.userid);
       alert(this.shopid);
       alert(this.ItemID);//(here item id show undefined)
       this._enqService.FetchStockitem(ItemID, this.shopid, this.userid).subscribe(defaultdatas =&gt; this.defaultdata = defaultdatas,
            error =&gt; {
                      console.error(error);
                      this.statusMessage = "Problem with the service.Please try again after sometime";
                  });
              $("#SearchModal").modal("hide");
          }
      }
  </code></pre>
  
  <p>My html</p>
  
  <pre><code>      &lt;div class="col-md-2 col-sm-2 col-xs-12 text-right"&gt;
                                  &lt;span class="btn btn-success Editmode-Btn" (click)="Editmodeclose()"&gt;&lt;i class="glyphicon glyphicon-pencil"&gt;&lt;/i&gt;&lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  &lt;ng-container *ngFor="let items of defaultdata;"&gt;
                      &lt;a [routerLink]="['/NewStockCount',items.ItemID]"&gt;
                          &lt;div class="row"&gt;
                              &lt;div class="col-md-12 col-sm-12 col-xs-12"&gt;
                                  &lt;div class="form-group"&gt;
                                      &lt;label&gt;Item Code&lt;/label&gt;
                                      &lt;span&gt;{{items.ItemCode}}&lt;/span&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class="row"&gt;
                              &lt;div class="col-md-12 col-sm-12 col-xs-12"&gt;
                                  &lt;div class="form-group"&gt;
                                      &lt;label&gt;Item Description&lt;/label&gt;
  
                                      &lt;span&gt;{{items.ItemDescription}}&lt;/span&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/a&gt;(....etc.......)
  </code></pre>
  
  <p></p>