我是yeoman和它使用的所有工具的新手。我在yeoman中創建了一個測試項目,並試圖在茉莉花中運行測試規範。越來越ReferenceError:找不到變量:angular
NPM安裝咕嚕-的contrib - 茉莉--save-dev的
新增當我運行在Gruntfile.js
jasmine: {
src: '<%= yeoman.app %>/scripts/{,*/}*.js',
specs: 'test/spec/{,*/}*.js'
},
茉莉花任務: 我一直在使用CMD安裝茉莉花插件茉莉花任務咕嚕茉莉我收到以下錯誤: -
E:\Personal Projects\yeoman-projects\test-app>grunt jasmine
Running "jasmine:src" (jasmine) task
Testing jasmine specs via phantom
ReferenceError: Can't find variable: angular at
..\..\..\E:\Personal%20Projects\yeoman-projects\test-app\app\scripts\app.js:3
ReferenceError: Can't find variable: angular at
..\..\..\E:\Personal%20Projects\yeoman-projects\test-app\app\scripts\controll
ers\main.js:3
以下是我main.js
'use strict';
angular.module('testAppApp')
.controller('MainCtrl', function ($scope) {
$scope.awesomeThings = [
'HTML5 Boilerplate',
'AngularJS',
'Karma'
];
});
和app.js
'use strict';
angular.module('testAppApp', [
'ngRoute'
])
.config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'views/main.html',
controller: 'MainCtrl'
})
.otherwise({
redirectTo: '/'
});
});
我這麼想嗎?
感謝, 帕裏克希特
當您從'https:// code.angularjs.org /'包含角度時,也會發生此問題。請將其包含在本地或Google託管庫API中。 –