ich den neuen Rahmen Angular2 von Google durch diese Videos Tutorials auf Youtube Lernen: https://www.youtube.com/watch?v=SEM6-TkuOgo„... dekoriert mit injizierbaren“ - Angular2
begegne ich andere Art von Fehler, wenn ich über Dienstleistungen zu lernen begann, wie :
EXCEPTION: Cannot resolve all parameters for 'ContactListComponent'(?). Make sure that all the parameters are decorated with Inject or have valid type annotations and that 'ContactListComponent' is decorated with Injectable.
EXCEPTION: Error: Uncaught (in promise): Cannot resolve all parameters for 'ContactListComponent'(?). Make sure that all the parameters are decorated with Inject or have valid type annotations and that 'ContactListComponent' is decorated with Injectable.
angular2-polyfills.js:469 Unhandled Promise rejection: Cannot resolve all parameters for 'ContactListComponent'(?). Make sure that all the parameters are decorated with Inject or have valid type annotations and that 'ContactListComponent' is decorated with Injectable. ; Zone: angular ; Task: Promise.then ; Value:
NoAnnotationError {message: "Cannot resolve all parameters for 'ContactListComp…ntactListComponent' is decorated with Injectable.", stack: "Error: Cannot resolve all parameters for 'ContactL…node_modules/angular2/bundles/angular2.js:477:94)"} message : "Cannot resolve all parameters for 'ContactListComponent'(?). Make sure that all the parameters are decorated with Inject or have valid type annotations and that 'ContactListComponent' is decorated with Injectable." stack : "Error: Cannot resolve all parameters for 'ContactListComponent'(?). Make sure that all the parameters are decorated with Inject or have valid type annotations and that 'ContactListComponent' is decorated/
angular2-polyfills.js:471 Error: Uncaught (in promise): Cannot resolve all parameters for 'ContactListComponent'(?). Make sure that all the parameters are decorated with Inject or have valid type annotations and that 'ContactListComponent' is decorated with Injectable.(…)
angular2-polyfills.js:469 Unhandled Promise rejection: Cannot resolve all parameters for 'ContactListComponent'(?). Make sure that all the parameters are decorated with Inject or have valid type annotations and that 'ContactListComponent' is decorated with Injectable. ; Zone: ; Task: Promise.then ; Value: NoAnnotationError {message: "Cannot resolve all parameters for 'ContactListComp…ntactListComponent' is decorated with Injectable.", stack: "Error: Cannot resolve all parameters for 'ContactL…node_modules/angular2/bundles/angular2.js:477:94)"}
angular2-polyfills.js:471 Error: Uncaught (in promise): Cannot resolve all parameters for 'ContactListComponent'(?). Make sure that all the parameters are decorated with Inject or have valid type annotations and that 'ContactListComponent' is decorated with Injectable.(…)
ich verstehe nicht, was die Konsole wirklich bedeutet, habe ich versucht, einen Teil des Codes zu kommentieren, wenn oder nicht meinen Code Kompilierung zu überprüfen, zu testen.
Wenn das Gefühl, dass das Problem, um diesen Teil in dem Kontakt-list.component.ts sein könnte:
constructor(private _contactService: ContactService) {}
Und auch dieses in dem contact.service.ts:
return Promise.resolve(CONTACTS);
Ich machte einen Screenshot der verschiedenen TypeScript-Dateien im Projekt: http://imgur.com/a/mqb5P
Wenn jemand etwas Ahnung hat, diesen Code zu debuggen, bin ich ganz Ohr! :)
PS: Ich kann den Code aus dem Screenshot kopieren/einfügen, wenn dies helfen könnte.
Ja ich verifiziert I importiert alle benötigten Dateien überprüft auch zweimal den Pfad zum Repository. Ich habe einen Plunker gemacht, damit es einfacher wird, den Code zu überprüfen: http://plnkr.co/edit/TBeK15tcQlVSkAjRTPSJ – Dabolo
Haben Sie das gleiche Problem, indem Sie Ihr '
Keine Änderung mit oder ohne ' '. –
Dabolo