我在使用 Angular.js 的日期选择器时收到以下错误。
错误信息
Error: [$compile:multidir] http://errors.angularjs.org/1.4.6/$compile/multidir?p0=datepicker&p1=&p2=da…-prev%3D%22%3Ci%20class%3D%26quot%3Bfa%20fa-arrow-circle-left%26quot%3B%3E
at Error (native)
at http://oditek.in/Gofasto/js/angularjs.js:6:416
at Q (http://oditek.in/Gofasto/js/angularjs.js:69:353)
at D (http://oditek.in/Gofasto/js/angularjs.js:62:492)
at http://oditek.in/Gofasto/js/angularjs.js:68:182
at http://oditek.in/Gofasto/js/angularjs.js:118:334
at n.$eval (http://oditek.in/Gofasto/js/angularjs.js:132:452)
at n.$digest (http://oditek.in/Gofasto/js/angularjs.js:129:463)
at n.$apply (http://oditek.in/Gofasto/js/angularjs.js:133:236)
at g (http://oditek.in/Gofasto/js/angularjs.js:87:376)
我在下面解释我的代码。
<div class="input-group bmargindiv1 col-md-12">
<span class="input-group-addon ndrftextwidth text-right" style="width:180px">Date :</span>
<datepicker date-format="dd-MM-y" button-prev='<i class="fa fa-arrow-circle-left"></i>' button-next='<i class="fa fa-arrow-circle-right"></i>'>
<input type="text" name="birthdate" class="form-control" ng-model="date" placeholder="Add date" />
</datepicker>
</div>
我已经包含了 720kb.datepicker
模块并添加了相应的 css 和 js 文件。但我仍然收到上述类型的错误。
请帮助我解决此错误。
最佳答案
Angularjs 正在导出一个 url 来解释错误消息
根据您的情况和说明找到您的上一个按钮定义。
Multiple directives [datepicker, da…-prev="{3}] asking for {4} on: {5}
Description This error occurs when multiple directives are applied to the same DOM element, and processing them would result in a collision or an unsupported configuration.
To resolve this issue remove one of the directives which is causing the collision.
Example scenarios of multiple incompatible directives applied to the same element include:
Multiple directives requesting isolated scope. Multiple directives publishing a controller under the same name. Multiple directives declared with the transclusion option. Multiple directives attempting to define a template or templateURL.
很可能 button-prev
或 button-next
与 datepicker
指令重叠。
关于javascript - js出现错误: [$compile:multidir] using Angular.,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33734478/