Bootstrap material design- floating labels are not floated when data is loaded dynamically

断了今生、忘了曾经 提交于 2019-12-10 20:39:33

问题


I am using bootstrap material design for my angular app. Everything works fine except when I change the models associated with inputs (floating label inputs) programmatically after the page has been loaded, the floating labels are not floated.


回答1:


You must fire a change event when you change the value programmatically.




回答2:


If you are using Angular2 then no custom directive is needed. On the label do something like this.

<label [class.active]="name && name.length > 0">Some Label</label>


来源:https://stackoverflow.com/questions/28688781/bootstrap-material-design-floating-labels-are-not-floated-when-data-is-loaded-d

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!