我对我的代码运行browserify后没有定义,它是如下:应用程序捆绑
import './app';
//——————————————————————————————————————————————————//
// Components
//——————————————————————————————————————————————————//
import './components/_ntToggleClass';
应用仅仅是
const app = angular.module('app', []);
而在components
文件,那么,组件。但他们使用的forementioned app
:
app.directive('ntToggleClass',() => {
... }
当我把一切都放在一个文件手工,所有的工作。但我用browserify在这之后,我得到
Uncaught ReferenceError: app is not defined
当我看到里面的代码,都var app
和指令的存在。
这没有帮助,对不起。 –
尝试使用'require(“./ components/_ntToggleClass.js”)',它应该直接复制文件的内容。 – Scott
也不起作用@ScottKaye –