我對我的代碼運行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 –