我需要将app.component.ts中的选择器名称(选择器:'app-root')更改为其他名称。
让它成为选择器:'new-selector‘。
它显示,
错误:“选择器"new- selector”不匹配任何元素“
当选择器名称更改时,哪些文件会受到影响?如何解决?
发布于 2018-09-05 19:32:05
如果您更改了app.component.ts选择器名称
然后需要在index.html中对其进行更改
from <app-root> </app-root>
to <new-selector> </new-selector>发布于 2018-09-05 19:40:15
必须完成的更改包括:
HTML:
<app-root> to <new-selector>Component.ts:
@Component {
selector: 'new-selector' //change here from app-root to new-selector
}希望对您有所帮助!!,如果没有,请分享stackblitz的工作示例
https://stackoverflow.com/questions/52184039
复制相似问题