扫码关注官方订阅号
我是用append动态增加的,但是内容不能绑定了
$("#chat").append("{{messages.messagetxt}}")
{{messages.messagetxt}}
请问有什么办法么?
ringa_lee
因为你的Html是异步的,需要使用$compile服务来手动编译记得依赖注入 $compile
var el=$compile("HTML代码")(scope); $('#chat').append(el);
使用
$compile("<p></p>")($scope)
来绑定~~
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
因为你的Html是异步的,需要使用$compile服务来手动编译
记得依赖注入 $compile
使用
来绑定~~