I can't get my Angular 5 plunker to work, it has the following error:
Error: Can't resolve all parameters for PersonService
I'm fairly sure it has something to do with the person service as everything else closely follows the application I've based this on.
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Rx';
import { Http } from '@angular/http';
@Injectable()
export class PersonService {
constructor(private _http: Http){}
getPerson() {
return this._http.get('./DummyAPI.html')
.map(response => response.text());
}
}
I'm trying to create it to demonstrate another problem I'm having.
Can someone please help me fix it?
Your app.module needs to import the 'HttpModule' and 'FormsModule' from '@angular/http' and '@angular/forms'. It should look something like this:
See working StackBlitz: https://stackblitz.com/edit/angular-h94pg7