angular报错信息之The selector "app" did not match any elements
//选择器“app”与任何元素都不匹配
Unhandled Promise rejection: The selector "app" did not match any elements ; Zone: `<root>` ; Task: Promise.then ; Value: Error: The selector "app" did not match any elements
//未处理的承诺拒绝:选择器“app”不匹配任何元素;区域:;任务:promise.then;值:错误:选择器“app”不匹配任何元素
当前错误原因是我们绑定在页面上的选择器不正确,
AppComponentHost.ngfactory.js? [sm]:1 ERROR Error: The selector "app" did not match any elements
at DefaultDomRenderer2.selectRootElement (vendor.js:115586)
at DebugRenderer2.selectRootElement (vendor.js:67167)
at createElement (vendor.js:62443)
at createViewNodes (vendor.js:65581)
at createRootView (vendor.js:65497)
at callWithDebugContext (vendor.js:66985)
at Object.debugCreateRootView [as createRootView] (vendor.js:66232)
at ComponentFactory.create (vendor.js:63235)
at ComponentFactoryBoundToModule.create (vendor.js:56573)
at ApplicationRef.bootstrap (vendor.js:58003)
一般文件设置selector在app.component.ts文件下修改当前值与src/index.html主页面一致即可
本文地址:https://www.zhuimengzhu.com/content/article/296.html
转载地址:暂无
转载说明: 转载时请在文首注明来源zhuimengzhu.com 及教程作者,并附本文链接。谢谢各位编辑同仁配合。zhuimengzhu 保留追究相应责任的权利。
QQ登录
微信登录