我正在设置我在github上访问的关于新的角度路由器的回购。
https://github.com/brandonroberts/angularjs-component-router
方向很简单
然而,我不能让回购和运行。
我在控制台上遇到了错误。特别是角分量不是函数。
angular.module('app.about', []).component('about', {
restrict: 'EA',
template: 'About {{ vm.name }}',
controller: AboutController,
controllerAs: 'vm'
});我不知道是怎么回事。我知道组件部分是一个对象。我更改了脚本标记,以确保它是1.5,但仍然得到相同的错误。
以下是我所犯的错误
Uncaught TypeError: angular.module(...).component is not a function
Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:
Error: [$injector:nomod] Module 'myApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.发布于 2016-04-16 01:37:15
如果您仍然看到这一点,那么有一个已知的角和beatarang问题可能会导致这个错误:
理论上,如果您更新到最新版本的所有东西,这看起来像它现在是固定的,但它可能是棘手的更新角,如果你使用保龄球,并有其他组件依赖于一个早期版本的角。
https://stackoverflow.com/questions/34732666
复制相似问题