角度DatePicker - 多个指令> [datepicker,datepicker] [英] Angular DatePicker - Multiple directives > [datepicker, datepicker]
问题描述
我正在尝试使用720Kb的日期戳。
https://github.com/720kb/angular-datepicker
使用简单的例子:
< datepicker>
< input ng-model =datetype =text/>
< / datepicker>
我收到打击错误:
< blockquote>
angular.js:11655错误:[$ compile:multidir]多个指令
[datepicker,datepicker]要求新的/隔离的范围:
http://errors.angularjs.org/1.3.15/ $ compile / multidir?p0 = datepicker& p1 = datep ... epicker%20class%3D%22datepicker%22%20date格式%3D%22dd%2FMM%2Fyyyy%22%3E
at angular.js:63
我注意到,如果我正在更改src文件中的指令的名称,例如datepickercust,上面的例子将会工作(改变标签)。
< datepickercust>
< input ng-model =datetype =text/>
< / datepickercust>
另外,如果我尝试相同的例子,将'datepicker'标签更改为'div'标签,并添加class ='datepicker'它工作正常。
< div class =datepicker>
< input ng-model =datetype =text/>
< / div>
我只是无法理解这里发生了什么?为什么原始示例不工作?
提前感谢
发现问题。 >
看起来UI Bootstrap仍然包含datepicker伪指令,该伪指令已被弃用,导致此问题。
现在需要看看我可以如何工作。
谢谢大家。 $ b
I'm trying to use the 720Kb datepicker. https://github.com/720kb/angular-datepicker
While using the simple example :
<datepicker>
<input ng-model="date" type="text"/>
</datepicker>
I'm getting the blow error:
angular.js:11655 Error: [$compile:multidir] Multiple directives [datepicker, datepicker] asking for new/isolated scope on: http://errors.angularjs.org/1.3.15/$compile/multidir?p0=datepicker&p1=datep…epicker%20class%3D%22datepicker%22%20date-format%3D%22dd%2FMM%2Fyyyy%22%3E at angular.js:63
I noticed that if I'm changing the name of the directive in the src file for example to datepickercust the above example will work (with changing the tags).
<datepickercust >
<input ng-model="date" type="text"/>
</datepickercust>
Also , if I'm trying the same example by changing the 'datepicker' tags to 'div' tags , and adding class='datepicker' it works fine.
<div class="datepicker">
<input ng-model="date" type="text"/>
</div>
I just can't understand what's going on here... why the original example not working ?
Thanks in advance.
Issue found.
Looks like UI Bootstrap still contain 'datepicker' directive which is deprecated and causing this issue .
Now need to see how I can work with both .
Thanks all.
这篇关于角度DatePicker - 多个指令> [datepicker,datepicker]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!