ng2中的占位符怎么去掉呢

1.页面中的占位符,比如<my-app></my-app>怎么在页面渲染后消掉

隔江千里
浏览 507回答 1
1回答

交互式爱情

这种写法去不掉的,replace属性已经被去掉了,看这个issue。解决这个问题的办法是在组件当中使用属性来替代你这种写法:js中定义: selector:&nbsp;'[myComponent]'html中使用: <div&nbsp;myComponent>Hello&nbsp;My&nbsp;component</div>参考链接:Remove the host HTML element selectors created by angular componentHow to remove/replace the angular2 component's selector tag from HTML
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript