0
Im使用Browserify進行捆綁和Angularjs框架。這種情況的出現,我有具有被定義爲指令中Angularjs組件 -當需要角度分量時找不到相對路徑
var loginDirective = /*@ngInject*/ function(){
return{
templateUrl:'views/login/templates/loginComponent.html',
link:function(scope,ele,attr){
}
}
};
這工作完全當我單獨使用browserify運行的組件。現在我有一個項目「MyAPP」,我使用NPM安裝來獲取這個組件在我的項目的node_modules文件夾中。 然後我需要這個及部件,包括做DI在這樣
var angular = require('angular');
require ('baseComponent');
module.exports = angular.module('mainComponent',['baseComponent'])
的DI工作正常的項目,但我得到一個錯誤說'views/login/templates/loginComponent.html'
找不到該成分導致它開始在我的項目搜索view
文件夾而不是自己的view
文件夾。
如何解決此問題?
是的,這終究是我最終做的,謝謝 –