title: AngularJS 2 Error undefined index1
body: <p>I'm trying to achieve a MeanStack Project, when i'm trying to hit the button update i get this error :
  Error: The requested path contains undefined segment at index 1</p>
  
  <p>There is the Update Service</p>
  
  <pre><code> updateLocation(id, data) {
      return new Promise((resolve, reject) =&gt; {
          this.http.put('https://exemple.herokuapp.com/api/A/'+id, data)
            .map(res =&gt; res.json())
            .subscribe(res =&gt; {
              resolve(res);
            }, (err) =&gt; {
              reject(err);
            });
      });
    }
  </code></pre>
  
  <p>the html</p>
  
  <pre><code>&lt;form (submit)="onEditSubmit()"&gt;
  </code></pre>
  
  <p>And the component.ts</p>
  
  <pre><code>  onEditSubmit() {
      this.locationService.updateLocation(this.id,this.location).then((result) =&gt; {
        let id = result['_id'];
        this.router.navigate(['locations/', id]);
      }, (err) =&gt; {
        console.log(err);
      });
    }
  </code></pre>