2016-05-05 42 views
1

我得到這個錯誤,我弄不清楚什麼是錯誤的,代碼是相同的,並在Angular 2 Beta 17中工作。我做的都正確,我檢查了Angular2網站幾次。Angular 2 RC1升級後發現沒有指令註釋

ERROR

EXCEPTION: No Directive annotation found on AWebAppComponent 
browser_adapter.ts:78EXCEPTION: No Directive annotation found on AWebAppComponentBrowserDomAdapter.logError @ browser_adapter.ts:78BrowserDomAdapter.logGroup @ browser_adapter.ts:89ExceptionHandler.call @ exception_handler.ts:53(anonymous function) @ application_ref.ts:345ZoneDelegate.invoke @ angular2-polyfills.js:349NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ angular2-polyfills.js:348Zone.run @ angular2-polyfills.js:242NgZoneImpl.runInner @ ng_zone_impl.ts:99NgZone.run @ ng_zone.ts:210ApplicationRef_.run @ application_ref.ts:335coreLoadAndBootstrap @ application_ref.ts:101bootstrap @ platform_browser_dynamic.ts:105execute @ init.ts:15ensureEvaluated @ system.src.js:3317execute @ system.src.js:3435doDynamicExecute @ system.src.js:798link @ system.src.js:1000doLink @ system.src.js:652updateLinkSetOnLoad @ system.src.js:700(anonymous function) @ system.src.js:512ZoneDelegate.invoke @ angular2-polyfills.js:349Zone.run @ angular2-polyfills.js:242(anonymous function) @ angular2-polyfills.js:597ZoneDelegate.invokeTask @ angular2-polyfills.js:382Zone.runTask @ angular2-polyfills.js:282drainMicroTaskQueue @ angular2-polyfills.js:500ZoneTask.invoke @ angular2-polyfills.js:452 
browser_adapter.ts:78STACKTRACE:BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:56(anonymous function) @ application_ref.ts:345ZoneDelegate.invoke @ angular2-polyfills.js:349NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ angular2-polyfills.js:348Zone.run @ angular2-polyfills.js:242NgZoneImpl.runInner @ ng_zone_impl.ts:99NgZone.run @ ng_zone.ts:210ApplicationRef_.run @ application_ref.ts:335coreLoadAndBootstrap @ application_ref.ts:101bootstrap @ platform_browser_dynamic.ts:105execute @ init.ts:15ensureEvaluated @ system.src.js:3317execute @ system.src.js:3435doDynamicExecute @ system.src.js:798link @ system.src.js:1000doLink @ system.src.js:652updateLinkSetOnLoad @ system.src.js:700(anonymous function) @ system.src.js:512ZoneDelegate.invoke @ angular2-polyfills.js:349Zone.run @ angular2-polyfills.js:242(anonymous function) @ angular2-polyfills.js:597ZoneDelegate.invokeTask @ angular2-polyfills.js:382Zone.runTask @ angular2-polyfills.js:282drainMicroTaskQueue @ angular2-polyfills.js:500ZoneTask.invoke @ angular2-polyfills.js:452 
browser_adapter.ts:78Error: No Directive annotation found on AWebAppComponent 
    at new BaseException (exceptions.ts:14) 
    at DirectiveResolver.resolve (directive_resolver.ts:54) 
    at CompileMetadataResolver.getDirectiveMetadata (metadata_resolver.ts:82) 
    at RuntimeCompiler.resolveComponent (runtime_compiler.ts:51) 
    at eval (application_ref.ts:104) 
    at eval (application_ref.ts:337) 
    at ZoneDelegate.invoke (angular2-polyfills.js:349) 
    at Object.NgZoneImpl.inner.inner.fork.onInvoke (ng_zone_impl.ts:67) 
    at ZoneDelegate.invoke (angular2-polyfills.js:348) 
    at Zone.run (angular2-polyfills.js:242)BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:57(anonymous function) @ application_ref.ts:345ZoneDelegate.invoke @ angular2-polyfills.js:349NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ angular2-polyfills.js:348Zone.run @ angular2-polyfills.js:242NgZoneImpl.runInner @ ng_zone_impl.ts:99NgZone.run @ ng_zone.ts:210ApplicationRef_.run @ application_ref.ts:335coreLoadAndBootstrap @ application_ref.ts:101bootstrap @ platform_browser_dynamic.ts:105execute @ init.ts:15ensureEvaluated @ system.src.js:3317execute @ system.src.js:3435doDynamicExecute @ system.src.js:798link @ system.src.js:1000doLink @ system.src.js:652updateLinkSetOnLoad @ system.src.js:700(anonymous function) @ system.src.js:512ZoneDelegate.invoke @ angular2-polyfills.js:349Zone.run @ angular2-polyfills.js:242(anonymous function) @ angular2-polyfills.js:597ZoneDelegate.invokeTask @ angular2-polyfills.js:382Zone.runTask @ angular2-polyfills.js:282drainMicroTaskQueue @ angular2-polyfills.js:500ZoneTask.invoke @ angular2-polyfills.js:452 
angular2-polyfills.js:349 Error: Error: No Directive annotation found on AWebAppComponent(…) 
+0

請包括髮生此錯誤的相關代碼 – Austin

回答

1

的問題是,我並沒有取代所有的import語句。

導入不好時會發生此錯誤。

我更正了導入,現在所有工作都正常。

+0

您的導入有什麼問題?我覺得我有同樣的問題。 –

+0

只是沒有輸入正確的,多數民衆贊成在所有。 – Teddy