title: Angular - TypeError: Cannot read property 'name' of undefined
body: <p>I'm not too sure how to phrase the question in a better way, but I 
  need some help in understanding how to resolve this. The following is my error:</p>
  
  <ol>
  <li><code>TypeError: _co.create is not a function</code></li>
  <li><code>TypeError: Cannot read property 'name' of undefined</code></li>
  </ol>
  
  <p>When I try to use <code>newCategory.name</code> in the html, it throws these errors in the console. So I think the problem lies within the HTML.</p>
  
  <p><strong>newCategory</strong> is defined in <strong>CreateCategoryComponent.ts</strong></p>
  
  <pre><code>newCategory: Category;
  name: string;
  description: string;
  </code></pre>
  
  <p><strong>CategoryService.ts</strong></p>
  
  <pre><code> //ommitted some redundant code
   baseUrl: string = "api/Category";
  
   createCategory(newCategory: Category) : Observable&lt;any&gt; {
  
    //Not too sure if newCategory is added correctly here
    return this.httpClient.get&lt;any&gt;(this.baseUrl+"username="+this.sessionService.getUsername()+"&amp;password="+this.sessionService.getPassword() + newCategory).pipe (
      catchError(this.handleError)
      );
    }
  </code></pre>
  
  <p><strong>CreateCategory.html</strong></p>
  
  <pre><code>&lt;td&gt;&lt;input id="name" name="name" #name="ngModel" type="text" [(ngModel)]="newCategory.name" required="true" /&gt;&lt;/td&gt;
  </code></pre>