export class MyClass {
// Here we're injecting the http service and our own data service
constructor(http: Http, data:Data){
this. http = http;
this.data = data;
// Here we have to create our own this. reference
}
}
export class MyClass {
// Here we're injecting the http service and our own data service
constructor(
public http: Http,
public data:Data){
// Now we don't need to add this.
// the Public keyword tells typescript
// that these are available through out the class as
// this.http and this.data
}
}