简体   繁体   English

无法使用angular.js注入datepicker模块

[英]Can not inject the datepicker module using angular.js

I am getting the following error while injecting the angular-datepicker module using angular.js. 使用angular.js注入angular-datepicker模块时遇到以下错误。

Error: 错误:

Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.4.6/$injector/modulerr?p0=Channabasavashwara&…0at%20d%20(http%3A%2F%2Foditek.in%2FGofasto%2Fjs%2Fangularjs.js%3A19%3A463)

I am explaining my code below. 我在下面解释我的代码。

plan.html: plan.html:

<div class="input-group bmargindiv1 col-md-12">
    <span class="input-group-addon ndrftextwidth text-right" style="width:180px">Date :</span>
    <datepicker date-format="MMMM d, y" date-min-limit="2010/01/01" date-max-limit="2020/01/01"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> 

The controller file contains the below code. 控制器文件包含以下代码。

var plan=angular.module('Channabasavashwara',['Channabasavashwara.datepicker']);
plan.controller('planController',function($scope,$http,$state){     
});

In this app i am using ui-router for view.I also need here after coming the calender when user will choose the date the date will visible in that textfield so that user can retrieve the value.Please help me to resolve this error. 在这个应用程序中,我正在使用ui-router进行查看。我还需要日历进入日历后,当用户选择日期在该文本字段中可见的日期时,以便用户可以检索该值。请帮助我解决此错误。

Instead of : 代替 :

angular.module('Channabasavashwara', ['Channabasavashwara.datepicker']);

You must have: 你必须有:

angular.module('Channabasavashwara', ['720kb.datepicker']);

In the documentation of the module, '720kb.datepicker' is not some random name. 在模块的文档中, '720kb.datepicker'不是一个随机名称。 It is the exact name of the module, and you have to use that exact name in the module dependencies array. 它是模块的确切名称,您必须在模块依赖项数组中使用该确切名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM