角度NG-检查会干扰的基础 [英] angular ng-checked interferes with foundation
问题描述
我现在面临一个bug,由于角度和基础之间的干扰。
I'm facing a bug due to an interference between angular and foundation.
基本上,我只是复制粘贴在doc提供的示例:
Basically, I just copy pasted the example provided in the doc:
Check me to check both: <input type="checkbox" ng-model="master"><br/>
<input id="checkSlave" type="checkbox" ng-checked="master">
两种情况:
-
当我有
的$(document).foundation();
:漂亮的设计,例如不工作
when I have
$(document).foundation();
: nice design, example does not work
在我评论的$(document).foundation();
:没有更多的基础善良,例如工作原理
when I comment $(document).foundation();
: no more foundation goodness, example works
我想这是由于由基础增加了额外的标记,但仍然,它不会有什么帮助。
I guess it's due to the additional markup added by foundation but still, it does not help much.
我要寻找一种方式来获得这两个......任你穿过这个问题跑了?
I am looking for a way to get both... any of you ran across this issue?
推荐答案
您不能只是调用库初始化像 .foundation()
上的角驱动的DOM因为DOM元素其实并不存在,直到角创建它们。
You can't just call a library initializer like .foundation()
on an Angular-driven DOM because the DOM elements actually don't exist until Angular creates them.
这是一个重大的速度凸点与任何客户端的MVC框架,但放心,你不是一个人在想实现这种类型的功能。
This is a major speed-bump with any client-side MVC framework, but be assured you are not alone in wanting to achieve this type of functionality.
的正确方法使用粉底用角将其包裹在小部件指令的。
The proper way to use Foundation with Angular would be to wrap its widgets in Directives.
这里有一些资源,帮助您:
Here are some resources to help you:
- How我认为AngularJS如果我有一个jQuery的背景是什么?
- 的一种方法使用jQuery插件与AngularJS
- 使用D3.js可视化图书馆与AngularJS
- AngularStrap - 引导指令为AngularJS
- 角UI
- 角模块
- How do I "think in AngularJS" if I have a jQuery background?
- An approach to use jQuery Plugins with AngularJS
- Using the D3.js Visualization Library with AngularJS
- AngularStrap - Bootstrap directives for AngularJS
- Angular UI
- Angular Modules
这篇关于角度NG-检查会干扰的基础的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!