模块 'video' 不可用
Module 'video' is not available
我正在使用 Angular-fullstack 作为生成器。我生成了一条名为视频的路线。但是当我 运行 g运行t test:client 我显示这个错误 -
Error: [$injector:nomod] Module 'video' 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.
http://errors.angularjs.org/1.5.3/$injector/nomod?p0=video
测试代码由angular-fullstack生成。这是我的测试代码 -
'use strict';
describe('Component: VideoComponent', function () {
beforeEach(module('video'));
var VideoComponent, scope;
beforeEach(inject(function ($componentController, $rootScope) {
scope = $rootScope.$new();
VideoComponent = $componentController('VideoComponent', {
$scope: scope
});
}));
it('should ...', function () {
expect(1).to.equal(1);
});
});
这是我正在测试的控制器代码 -
'use strict';
(function(){
class VideoComponent {
constructor() {
this.message = 'Hello';
}
}
angular.module('video')
.component('video', {
templateUrl: 'app/video/video.html',
controller: VideoComponent
});
})();
谁能告诉我这里出了什么问题。提前致谢!!
我 运行 在第一次使用 angular-fullstack 时遇到了同样的问题。我认为您必须将组件名称更改为 'video' 在您描述测试的地方,因为您在控制器中将视频作为组件名称。
describe('Component: video', function () {
beforeEach(module('video'));
.......
.......
我正在使用 Angular-fullstack 作为生成器。我生成了一条名为视频的路线。但是当我 运行 g运行t test:client 我显示这个错误 -
Error: [$injector:nomod] Module 'video' 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.
http://errors.angularjs.org/1.5.3/$injector/nomod?p0=video
测试代码由angular-fullstack生成。这是我的测试代码 -
'use strict';
describe('Component: VideoComponent', function () {
beforeEach(module('video'));
var VideoComponent, scope;
beforeEach(inject(function ($componentController, $rootScope) {
scope = $rootScope.$new();
VideoComponent = $componentController('VideoComponent', {
$scope: scope
});
}));
it('should ...', function () {
expect(1).to.equal(1);
});
});
这是我正在测试的控制器代码 -
'use strict';
(function(){
class VideoComponent {
constructor() {
this.message = 'Hello';
}
}
angular.module('video')
.component('video', {
templateUrl: 'app/video/video.html',
controller: VideoComponent
});
})();
谁能告诉我这里出了什么问题。提前致谢!!
我 运行 在第一次使用 angular-fullstack 时遇到了同样的问题。我认为您必须将组件名称更改为 'video' 在您描述测试的地方,因为您在控制器中将视频作为组件名称。
describe('Component: video', function () {
beforeEach(module('video'));
.......
.......