Hi,
I’m new to ionic 2 and angular and trying ultimately to create a json call to my backend service. I have the following code:
import {Injectable, Inject} from '@angular/core';
import {Http} from '@angular/http';
@Injectable()
export class MyProvider {
constructor(http: Http) {
this.http = http;
}
}
…but in my IDE it’s saying "property http does not exist on type ‘MyProvider’. Can someone tell me why it says that?
If i add the “private” word in the constructor the error goes away. As in:
constructor(private http: Http) {
this.http = http;
}
My ionic info:
Cordova CLI: 4.3.1
Ionic CLI Version: 2.0.0-beta.37
Ionic App Lib Version: 2.0.0-beta.20
Node Version: v4.5.0