title: Angular 4 can't find name (generics)
body: <p>I have a problem with Angular 4. TypeScript doesn't compile and gives me errors when I run <code>ng serve</code>.</p>
  
  <blockquote>
    <p>Error in my-data.service.ts (9,30) Cannot find name 'Category'<br>
    Error in my-data.service.ts (13,17) Cannot find name 'Category'</p>
  </blockquote>
  
  <p><strong>my-data.service.ts</strong></p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { Http } from '@angular/http';
  import { Observable } from 'rxjs';
  @Injectable()
  export class MyDataService {
      database:string = 'http://localhost/exploremo2/material/database/';
      database2:string = 'http://192.168.254.105/exploremo2/material/database/';
      constructor(private http: Http) {}
      getCategories(): Observable&lt;Category[]&gt;{
          return this.http.get(this.database+'getdata/getallcategory.php')
              .map(res =&gt; {
                  return res.json().results.map(item =&gt; {
                      return new Category(item);
                  });
              });
      }
  }
  </code></pre>
  
  <p><strong>add.component.ts</strong></p>
  
  <pre><code>import { Component, OnInit   } from '@angular/core';
  import { Title } from '@angular/platform-browser';
  import { fadeInAnimation } from '../_animations/fadein';
  import { slideInOutAnimation } from '../_animations/slide';
  import { MyDataService} from '../my-data.service';
  import { Observable } from 'rxjs';
  
  @Component({
    selector: 'app-add',
    templateUrl: './add.component.html',
    styleUrls: ['./add.component.css','../app.component.css'],
    providers: [Title],
    animations: [slideInOutAnimation],
  })
  export class AddComponent implements OnInit {
      private Categories:Observable&lt;any&gt;;
      constructor( private title: Title, private MyDataService:MyDataService) { 
       this.title.setTitle('Add');
      }
      ngOnInit() {
          this.Categories = this.MyDataService.getCategories();
      }
  }
  </code></pre>