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

Angular1 插入属性未生效

  •  
  •   keithsun80 · 2015-11-22 22:30:32 +08:00 · 2575 次点击
    这是一个创建于 3049 天前的主题,其中的信息可能已经有所发展或是发生改变。

    国外买了一套基于 angular 的模板

    在生成一个 Table 的时候 我需要将列表中的部分元素添加 一个事件

    静态内容如下
    <h4 class="page-header" popover="Test" popover-trigger="mouseenter" >
    可以生效, 会捕获鼠标的 mouseover 事件,当鼠标移动到元素中国年时显示 popover 对应内容

    Controller 中请求回调事件数据初始化后, 我通过如下方式去修改对应列内容, 调试模式下下 html 内容已经变动, 但是未生效
    $($('.ag-angle').find('.cell-col-2')[i]).attr('popover',item.content);
    $($('.ag-angle').find('.cell-col-2')[i]).attr('popover-trigger',"mouseenter");

    肿么回事呢, 请各位帮下忙哈, 不行我就换一个姿势去做.

    2 条回复    2016-02-25 11:16:08 +08:00
    markocen
        1
    markocen  
       2016-01-14 03:20:39 +08:00
    如果 popover 和 popoverTrigger 是两个 angular directive 的话,通过 jquery 对其进行修改 angular 内部是不会感知到的
    dong3580
        2
    dong3580  
       2016-02-25 11:16:08 +08:00
    @markocen
    需要赋值给对应的 model ,不过不知道模板具体代码,所以其实也不好确定,不知道楼主解决 @keithsun80
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1196 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 18:16 · PVG 02:16 · LAX 11:16 · JFK 14:16
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.