2016-09-13 30 views
10

yok sağlayıcı alma hatası:Eğik 2 - JSONP

inline template:16:8 caused by: No provider for Jsonp! 
ORIGINAL EXCEPTION: No provider for Jsonp! 

doğrudan bileşeni bir parçası olan modüle 'HttpModule'ü' ithal ediyorum.

cevap

29

Sen

import { HttpModule, JsonpModule } from '@angular/http'; 

@NgModule({ 
    imports: [ 
    BrowserModule, 
    FormsModule, 
    HttpModule, 
    JsonpModule 
    ], 
    declarations: [ AppComponent ], 
    bootstrap: [ AppComponent ] 
}) 
export class AppModule { } 
+1

yaa ben bilinen her şey artık bir modüldür olmalıdır, ithalat gerekiyor ve aşağıda gösterildiği gibi JsonpModule ilan ediyoruz. – Nik