1.頁(yè)面中的占位符,比如<my-app></my-app>怎么在頁(yè)面渲染后消掉
ng2中的占位符怎么去掉呢
隔江千里
2018-09-18 09:18:35
TA貢獻(xiàn)1712條經(jīng)驗(yàn) 獲得超3個(gè)贊
這種寫法去不掉的,replace屬性已經(jīng)被去掉了,看這個(gè)issue。
解決這個(gè)問(wèn)題的辦法是在組件當(dāng)中使用屬性來(lái)替代你這種寫法:
js中定義: selector: '[myComponent]'html中使用: <div myComponent>Hello My component</div>
參考鏈接:
Remove the host HTML element selectors created by angular component
How to remove/replace the angular2 component's selector tag from HTML
舉報(bào)