为了账号安全,请及时绑定邮箱和手机立即绑定

ng2中的占位符怎么去掉呢

ng2中的占位符怎么去掉呢

隔江千里 2018-09-18 09:18:35
1.页面中的占位符,比如<my-app></my-app>怎么在页面渲染后消掉
查看完整描述

1 回答

?
交互式爱情

TA贡献1712条经验 获得超3个赞

这种写法去不掉的,replace属性已经被去掉了,看这个issue

解决这个问题的办法是在组件当中使用属性来替代你这种写法:

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


查看完整回答
反对 回复 2018-10-19
  • 1 回答
  • 0 关注
  • 506 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号