简体   繁体   English

未捕获的ReferenceError:模块未定义

[英]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.

相关问题 未捕获的ReferenceError:模块未定义RequireJS - Uncaught ReferenceError: module is not defined RequireJS 初始化程序抛出错误:未捕获ReferenceError:模块未定义 - Initializers throwing error: Uncaught ReferenceError: module is not defined 未捕获ReferenceError:未在控制器,模块和路由中定义应用 - Uncaught ReferenceError: app is not defined in controller, module, and route 未捕获的ReferenceError:未为导入的模块定义值 - Uncaught ReferenceError: value is not defined for imported module “类型:模块” - 未捕获的 ReferenceError:需要未定义 - “type: module” - Uncaught ReferenceError: require is not defined 从node.js开始获取错误Uncaught ReferenceError:模块未定义,而Uncaught ReferenceError:require未定义 - Starting off in node.js getting errors Uncaught ReferenceError: module is not defined, and Uncaught ReferenceError: require is not defined 错误:未捕获的 ReferenceError:使用 module.export 时未定义模块 - Error: Uncaught ReferenceError: module is not defined when using module.export 未捕获的 ReferenceError ReferenceError:未定义事项 - Uncaught ReferenceError ReferenceError: Matter is not defined 未捕获的 ReferenceError ReferenceError:未定义问题 - Uncaught ReferenceError ReferenceError: question is not defined 未捕获的ReferenceError:未定义functionName - Uncaught ReferenceError: functionName is not defined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM