I am currently working on an angular2 project with typescript in Intellij15. I have already imported 'rxjs/add/operator/map', but I am still encountering the error mentioned above. Despite checking various similar questions on SO, I have not been able to find a solution.
import {Component, OnInit} from "@angular/core";
import {Http} from "@angular/http";
import 'rxjs/add/operator/map';
@Component({
selector: "h-recommend",
template:`
<div>
hi
</div>
`
})
export class Recommendations implements OnInit{
constructor (private _http: Http){}
ngOnInit():any {
this._http.get('../jsonfile/guestRecommendations/1.json')
.map(res => res.json())
.subscribe((data) => {
this.hello();
alert(data);
});
}
hello(){
alert("hello");
}
}