EXCEPTION: No provider for Http!
Angular 앱을 받고 있습니다. 내가 뭘 잘못하고 있죠?
import {Http, Headers} from 'angular2/http';
import {Injectable} from 'angular2/core'
@Component({
selector: 'greetings-ac-app2',
providers: [],
templateUrl: 'app/greetings-ac2.html',
directives: [NgFor, NgModel, NgIf, FORM_DIRECTIVES],
pipes: []
})
export class GreetingsAcApp2 {
private str:any;
constructor(http: Http) {
this.str = {str:'test'};
http.post('http://localhost:18937/account/registeruiduser/',
JSON.stringify(this.str),
{
headers: new Headers({
'Content-Type': 'application/json'
})
});
HttpModule
해야하는지, 그리고 무엇 을 하는지 설명하면 좋을 것 입니다.
HTTP_PROVIDERS
.