【发布时间】:2016-01-16 00:55:13
【问题描述】:
我正在尝试调试我的业力设置如何没有预处理我的指令模板。
我希望通过设置 moduleName: foo 我可以轻松地在 Chrome 调试控制台中获取模块并查看发生了什么,但是在调试中尝试 angular.module('foo') 会返回 no module found 错误,这让我相信问题出在其他地方。
我还尝试将 html 预处理器更改为一些无意义的字符串,希望 karma 会引发错误,但事实并非如此。这使我认为问题可能在于我的模板没有正确的路径,但如果我将该路径更改为其他路径,它确实会引发错误no files match this path。
我是否缺少任何调试选项/方法?有没有办法记录 ng-html2js 的输入/输出?
这是我的karma.conf.js
module.exports = function(config) {
config.set({
plugins: [
// these plugins will be require() by Karma
'ng-html2js',
'jasmine',
'karma-jasmine',
'karma-phantomjs-launcher',
'karma-chrome-launcher'
],
basePath: '',
// frameworks to use
frameworks: ['jasmine'],
files: [
APPLICATION_SPEC,
'../app/assets/javascripts/image-crop.js',
'../app/assets/javascripts/angular/**/*.js',
'../spec/javascripts/**/*_spec.js',
"../public/templates/**/*.html"
],
exclude: [
'./app/bower_components/angular/angular.min.js'
],
reporters: ['progress'],
preprocessors: {
'**/*.html': ['ng-html2js']
},
ngHtml2JsPreprocessor: {
stripPrefix: 'public/templates',
moduleName: 'foo',
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['PhantomJS', 'Chrome'],
singleRun: false
});
};
【问题讨论】:
标签: angularjs