Khi tôi cố gắng nhập HTTP_PROVIDERS từ góc/http Tôi có lỗi này:HTTP_PROVIDERS nhập khẩu app.component.ts
Error:(3, 9) TS2305: Module '"projectname/node_modules/@angular/http/index"' has no exported member 'HTTP_PROVIDERS'.
đây là nội dung tập tin của tôi:
import { Component } from '@angular/core';
import {GithubService} from './services/github.service';
import {HTTP_PROVIDERS} from '@angular/http';
@Component({
selector: 'my-app',
template: '<h1>My First Angular 2 App</h1><Profile></Profile>',
providers: [ HTTP_PROVIDERS, GithubService ]
})
export class AppComponent { }
cho những gì tôi cần 'HTTP_PROVIDERS' và cách để sử dụng? – OPV
'HTTP_PROVIDERS' đã được thay thế bởi 'HttpModule' ngay trước khi phát hành chính thức 2.0.0 đầu tiên. –
tôi đã nhận nó, nhưng chúng tôi nhập khẩu để làm gì? – OPV