我是Angular的新手,我尝试实现组件路由。 但是,我总是收到错误(从浏览器控件中复制):
localhost
我的模块看起来像这样:
> ZoneAwareError {__zone_symbol__error: Error: TypeError: Cannot read
> property 'isPromise' of undefined at Object.eval (http://localhos……}
> message : (...) name : (...) originalErr : TypeError: Cannot read
> property 'isPromise' of undefined at Object.eval
> (http://localhost:61230/node_modules/@angular/forms/bundles/forms.umd.js:375:68)
> at execute
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:4144:30)
> at linkDynamicModule
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:3252:32)
> at getModule
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:3220:9)
> at
> http://localhost:61230/node_modules/systemjs/dist/system.src.js:3256:16
> at require
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:3893:29)
> at Object.eval (http://localhost:61230/app/app.module.js:10:15) at
> eval (http://localhost:61230/app/app.module.js:42:4) at eval
> (http://localhost:61230/app/app.module.js:43:3) at eval (<anonymous>)
> at SystemJSLoader.__exec
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:1510:18)
> at entry.execute
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:3926:18)
> at linkDynamicModule
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:3252:32)
> at getModule
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:3220:9)
> at
> http://localhost:61230/node_modules/systemjs/dist/system.src.js:3256:16
> message : "Cannot read property 'isPromise' of undefined" stack :
> "TypeError: Cannot read property 'isPromise' of undefined↵ at
> Object.eval
> (http://localhost:61230/node_modules/@angular/forms/bundles/forms.umd.js:375:68)↵
> at execute
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:4144:30)↵
> at linkDynamicModule
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:3252:32)↵
> at getModule
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:3220:9)↵
> at
> http://localhost:61230/node_modules/systemjs/dist/system.src.js:3256:16↵
> at require
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:3893:29)↵
> at Object.eval (http://localhost:61230/app/app.module.js:10:15)↵ at
> eval (http://localhost:61230/app/app.module.js:42:4)↵ at eval
> (http://localhost:61230/app/app.module.js:43:3)↵ at eval
> (<anonymous>)↵ at SystemJSLoader.__exec
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:1510:18)↵
> at entry.execute
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:3926:18)↵
> at linkDynamicModule
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:3252:32)↵
> at getModule
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:3220:9)↵
> at
> http://localhost:61230/node_modules/systemjs/dist/system.src.js:3256:16"
> __proto__ : Error originalStack : (...) stack : (...) toSource : function () toString : function () zoneAwareStack : (...)
> __zone_symbol__currentTask : ZoneTask
> __zone_symbol__error : Error: TypeError: Cannot read property 'isPromise' of undefined at Object.eval
> (http://localhost:61230/node_modules/@angular/forms/bundles/forms.umd.js:375:68)
> at Object.eval (http://localhost:61230/app/app.module.js:10:15) at
> eval (http://localhost:61230/app/app.module.js:42:4) at eval
> (http://localhost:61230/app/app.module.js:43:3) at eval (<anonymous>)
> Evaluating http://localhost:61230/app/app.module.js Evaluating
> http://localhost:61230/app/main.js Error loading
> http://localhost:61230/app/main.js at Object.eval
> (http://localhost:61230/node_modules/@angular/forms/bundles/forms.umd.js:375:68)
> at Object.eval (http://localhost:61230/app/app.module.js:10:15) at
> eval (http://localhost:61230/app/app.module.js:42:4) at eval
> (http://localhost:61230/app/app.module.js:43:3) at eval (<anonymous>)
> Evaluating http://localhost:61230/app/app.module.js Evaluating
> http://localhost:61230/app/main.js Error loading
> http://localhost:61230/app/main.js at addToError
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:123:78)
> [<root>] at linkSetFailed
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:718:15)
> [<root>] at
> http://localhost:61230/node_modules/systemjs/dist/system.src.js:653:9
> [<root>] at doDynamicExecute
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:801:7)
> [<root>] at link
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:1000:20)
> [<root>] at doLink
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:652:7)
> [<root>] at updateLinkSetOnLoad
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:700:18)
> [<root>] at
> http://localhost:61230/node_modules/systemjs/dist/system.src.js:512:11
> [<root>] at Zone.run
> (http://localhost:61230/node_modules/zone.js/dist/zone.js:126:43)
> [<root> => <root>] at
> http://localhost:61230/node_modules/zone.js/dist/zone.js:713:57
> [<root>] at Zone.runTask
> (http://localhost:61230/node_modules/zone.js/dist/zone.js:166:47)
> [<root> => <root>] at drainMicroTaskQueue
> (http://localhost:61230/node_modules/zone.js/dist/zone.js:546:35)
> [<root>] at XMLHttpRequest.ZoneTask.invoke
> (http://localhost:61230/node_modules/zone.js/dist/zone.js:424:25)
> [<root>]
> __zone_symbol__stack : "Error: TypeError: Cannot read property 'isPromise' of undefined↵ at Object.eval
> (http://localhost:61230/node_modules/@angular/forms/bundles/forms.umd.js:375:68)↵
> at Object.eval (http://localhost:61230/app/app.module.js:10:15)↵
> at eval (http://localhost:61230/app/app.module.js:42:4)↵ at eval
> (http://localhost:61230/app/app.module.js:43:3)↵ at eval
> (<anonymous>)↵ Evaluating
> http://localhost:61230/app/app.module.js↵ Evaluating
> http://localhost:61230/app/main.js↵ Error loading
> http://localhost:61230/app/main.js↵ at addToError
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:123:78)
> [<root>]↵ at linkSetFailed
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:718:15)
> [<root>]↵ at
> http://localhost:61230/node_modules/systemjs/dist/system.src.js:653:9
> [<root>]↵ at doDynamicExecute
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:801:7)
> [<root>]↵ at link
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:1000:20)
> [<root>]↵ at doLink
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:652:7)
> [<root>]↵ at updateLinkSetOnLoad
> (http://localhost:61230/node_modules/systemjs/dist/system.src.js:700:18)
> [<root>]↵ at
> http://localhost:61230/node_modules/systemjs/dist/system.src.js:512:11
> [<root>]↵ at Zone.run
> (http://localhost:61230/node_modules/zone.js/dist/zone.js:126:43)
> [<root> => <root>]↵ at
> http://localhost:61230/node_modules/zone.js/dist/zone.js:713:57
> [<root>]↵ at Zone.runTask
> (http://localhost:61230/node_modules/zone.js/dist/zone.js:166:47)
> [<root> => <root>]↵ at drainMicroTaskQueue
> (http://localhost:61230/node_modules/zone.js/dist/zone.js:546:35)
> [<root>]↵ at XMLHttpRequest.ZoneTask.invoke
> (http://localhost:61230/node_modules/zone.js/dist/zone.js:424:25)
> [<root>]" get message : function () set message : function (value) get
> name : function () set name : function (value) get originalStack :
> function () set originalStack : function (value) get stack : function
> () set stack : function (value) get zoneAwareStack : function () set
> zoneAwareStack : function (value)
> __proto__ : Object
每次都会发生这种情况,并且没有一条路线有效。 我该怎么办?有人可以帮忙吗?