Angular DatePicker - 多个指令 >[日期选择器,日期选择器] [英] Angular DatePicker - Multiple directives > [datepicker, datepicker]

查看:44
本文介绍了Angular DatePicker - 多个指令 >[日期选择器,日期选择器]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 720Kb 日期选择器.https://github.com/720kb/angular-datepicker

虽然使用简单的例子:

<input ng-model="date" type="text"/></日期选择器>

我收到了吹气错误:

<块引用>

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-format%3D%22dd%2FMM%2Fyyyy%22%3E在 angular.js:63

我注意到,如果我将 src 文件中的指令名称更改为 datepickercust,则上面的示例将起作用(更改标签).

<input ng-model="date" type="text"/></datepickercust>

此外,如果我通过将 'datepicker' 标签更改为 'div' 标签并添加 class='datepicker' 来尝试相同的示例,则它工作正常.

 

<input ng-model="date" type="text"/>

我就是不明白这里发生了什么……为什么原来的例子不起作用?

提前致谢.

解决方案

发现问题.

看起来 UI Bootstrap 仍然包含datepicker"指令,该指令已被弃用并导致此问题.

现在需要看看我如何处理两者.

谢谢大家.

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.

这篇关于Angular DatePicker - 多个指令 &gt;[日期选择器,日期选择器]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆