所以在我的 app.module 中,我有一些注入器,它们实际上是存储模板的 html 元素指令的目录。问题是业力抱怨目录不可用。如何加载或获取业力以忽略注入的依赖项?
特别是:模板,提供者表格,结帐表格
var app = angular.module("DoctiblePreTreatment", ['ngDialog', 'ngResource', 'ngRoute', 'ui.select2', 'templates', 'provider-form', 'checkout-form', 'ui.mask', 'widget-filters', 'focus', 'ui.bootstrap', 'ngGrid', 'google-maps', 'angularFileUpload', 'angularPayments', 'angular-loading-bar', 'ngAnimate', 'loader']);
错误:
Error: [$injector:modulerr] Failed to instantiate module DoctiblePreTreatment due to:
Error: [$injector:modulerr] Failed to instantiate module templates due to:
Error: [$injector:nomod] Module 'templates' 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.
karma.conf.js 文件
// Karma configuration
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '/Users/giowong/rails_project/doctible_pre_treatment/',
// testing framework to use (jasmine/mocha/qunit/...)
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'app/assets/components/angular/angular.js',
'app/assets/components/angular-mocks/angular-mocks.js',
'app/assets/components/angular-resource/angular-resource.js',
'app/assets/components/ngDialog/js/ngDialog.js',
'app/assets/components/angular-route/angular-route.js',
'app/assets/components/jquery-1.11.1.min.js',
'app/assets/javascripts/main.js',
'app/assets/javascripts/**/**/*.js',
'app/assets/javascripts/*.js',
'spec/javascripts/*.js'
],
// list of files / patterns to exclude
exclude: ['app/assets/javascripts/angular-google-maps.min.js'
],
// web server port
port: 8080,
// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['Chrome'],
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: true
});
};