Angular 2.避免错过选择器错误

时间:2016-08-29 16:27:36

标签: angular

如果在当前页面上错过选择器,我该如何避免错误? 例如,我有一些组件:

@Component({
    selector: 'SomeDirrective',
    template: `<h1>Out</h1>`
})

如果页面有

<SomeDirrective>Loading...</SomeDirrective>
然后一切都很好,但我不想要这个&#34; SomeDirrective&#34;在每个页面上,如果错过了这个元素,A2将产生错误:

&#34;选择器&#34; SomeDirrective&#34;与任何元素都不匹配&#34;

哪个部分应该更改或如何抑制错误?

0 个答案:

没有答案
相关问题