[英]Uncaught ReferenceError: module is not defined
As the name implies. 顾名思义。 I am experiencing an issue using the reserved keyword "Module" on bower launch. 我在Bower启动时使用保留关键字“ Module”遇到问题。 It seems to relate specifically to the code below. 它似乎与下面的代码特别相关。 I cannot seem to find the exact location, as it starts at "fetch-bower.js:1". 我似乎找不到确切的位置,因为它始于“ fetch-bower.js:1”。 Can anyone please help me to understand how to work around this problem? 谁能帮助我了解如何解决此问题?
(function () {
'use strict';
angular.module('BlurAdmin.theme.components')
.directive("digitalClock", function ($timeout, dateFilter) {
return {
restrict: 'E',
link: function (scope, iElement) {
(function updateClock() {
iElement.text(dateFilter(new Date(), 'H:mm:ss'));
$timeout(updateClock, 1000);
})();
}
};
});
});
//HTML // HTML
<div class="page-top clearfix" scroll-position="scrolled" max-height="50" ng-class="{'scrolled': scrolled}">
<div class="row col-xs-12">
<div class=""></div>
<div class="aguState col-xs-3 setText">Agu State: </div>
<div class="aguMode col-xs-3 setText">Agu Mode: </div>
<div class="lastUpdate col-xs-3 setText">Last Update: </div>
<digital-clock></digital-clock>
</div>
//Directive.js //Directive.js
(function () {
'use strict';
angular.module('BlurAdmin.theme.components')
.directive('pageTop', pageTop);
/** @ngInject */
function pageTop() {
return {
restrict: 'E',
templateUrl: 'app/theme/components/pageTop/pageTop.html'
};
}
})();
full error 完全错误
fetch-bower.js:1 Uncaught ReferenceError: module is not defined
at fetch-bower.js:1
(anonymous) @ fetch-bower.js:1
Make sure you refer the angular.js and Directive.js in the index.html of the application 确保在应用程序的index.html中引用angular.js和Directive.js
<script src="angular.js"></script>
<script src="directive.js"></script>
also you should have empty dependencies injected to your application, 您还应该将空的依赖项注入到您的应用程序中,
angular.module('BlurAdmin.theme.components',[])
.directive('pageTop', pageTop)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.