微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

angularjs – 奇怪的angle-ui datepicker依赖性错误

只是重新安装了一些凉爽的组件,但是这里的组件没有更新,相同的0.12.0 ui.bootstrap。还使用ui-router 0.2.13将状态更改为另一个页面

奇数错误信息是

错误:[$ compile:ctreq]无法找到指令’daypicker’所需的控制器’datepicker’!

但是当我看看ui-bootstrap-tpls.js文件时,datepicker控制器被直接定义在daypicker之上,应该被拾取。

这可能是由于一个错误的冲突的datepicker类名或某事吗?

我知道这不是很多,但会更新,因为我有时间添加代码。似乎有可能在某个地方有冲突的日期戳。它只发生在stateChange从一个页面到另一个页面。使用datepicker的完整流程工作正常,直到最后一页。如果控制器依赖关系在同一个文件中,怎么可能会被错过?

在任何人看到这个机会之前,我将不胜感激任何指导。

UPDATE Apr 23 15:正在使用带有表单的模态对话框,将会将用户发送到另一个页面上,单击确定。

我有这个错误更新到ui.bootstrap 0.14.x.

我已经在自己的模块中覆盖了造成问题的模板:

angular.module("template/datepicker/datepicker.html",[]).run(["$templateCache",function ($templateCache) {
    $templateCache.put("template/datepicker/datepicker.html","<div ng-switch=\"datepickerMode\" role=\"application\" ng-keydown=\"keydown($event)\">\n" +
      "  <daypicker ng-switch-when=\"day\" tabindex=\"0\"></daypicker>\n" +
      "  <monthpicker ng-switch-when=\"month\" tabindex=\"0\"></monthpicker>\n" +
      "  <yearpicker ng-switch-when=\"year\" tabindex=\"0\"></yearpicker>\n" +
      "</div>");
    }]);

卸下模块后,再次工作。

本来我已经改变了使用font-awesome图标而不是glyphicons的模板。现在我覆盖glyphicon css类改为font-awesome图标:

.glyphicon {
    font: normal normal normal 14px/1 ourIconFont;
}
.glyphicon-arrow-right:before,.glyphicon-chevron-right:before {
    content: "\f054";
}
.glyphicon-arrow-left:before,.glyphicon-chevron-left:before {
    content: "\f053";
}

原文地址:https://www.jb51.cc/angularjs/144504.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐