【问题标题】:Bootstrap popover html template can't read angular directiveBootstrap popover html模板无法读取角度指令
【发布时间】:2015-06-03 06:16:19
【问题描述】:

我正在尝试使用外部 HTML 文件制作引导弹出框。 弹出框与模板配合得很好,但我遇到了一个问题: 我无法使指令与模板文件一起使用。 在模板schools.html 中,您可以看到对名为changeColor 的指令的调用。当我单击按钮时,指令不起作用。

这里是 plunker:http://embed.plnkr.co/YAfwK5/preview

【问题讨论】:

  • 请在您的问题中包含相关代码。

标签: html angularjs templates popover


【解决方案1】:

我已经更新了你的 plnkr,查看结果here

相关变化:

  • 在 HTML 中将 changeColor 更改为 change-color 以链接指令
  • 在指令中将$('.changeColor') 更改为elem()
  • 在指令中将$('.btm-primary') 更改为elem()

【讨论】:

  • 如果答案让您满意,请使用答案前面的复选标记接受答案
猜你喜欢
  • 1970-01-01
  • 2013-11-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-03-19
  • 2016-06-02
  • 1970-01-01
相关资源
最近更新 更多