V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Wilon
V2EX  ›  Angular

使用 ng-bind-html 动态修改 html 内容,其中 ng-click 没有反应

  •  
  •   Wilon · 2017-02-09 11:26:48 +08:00 · 2072 次点击
    这是一个创建于 2624 天前的主题,其中的信息可能已经有所发展或是发生改变。

    查了一下网上的资料,说是要手动 compile 动态的 html 内容才行,请问具体怎么操作?谢谢大家

    1 条回复    2017-02-18 13:22:58 +08:00
    WenJimmy
        1
    WenJimmy  
       2017-02-18 13:22:58 +08:00
    写成指令, watch 内容变化,然后 compile.
    还有一个不知道相不相关 https://docs.angularjs.org/api/ng/service/$sce 可能只是格式之类的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5775 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 02:57 · PVG 10:57 · LAX 19:57 · JFK 22:57
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.