2016-10-23 3 views
0

angularjs와 함께 webpack을 사용하려고하지만이 컨트롤러를 요구하고 실행하려고 할 때 컨트롤러를 만들 수 없습니다 : __webpack_require__(...) is not a function. 다음은 내 app.js 및 컨트롤러 코드 : 작동 할 수webpack을 사용하는 AngularJs 컨트롤러가 필요합니다

//app.js 
var angular = require('angular'); 
var weatherModule = angular.module('weather', []); 

require('./shared/directives/app.directives')(weatherModule); 
require('./weather/weather.controller')(weatherModule); 

//weather.controller.js 
module.export = function(weatherModule) { 
    weatherModule.controller('WeatherCtrl', ['$scope', function($scope){ 
     $scope.greetings = 'Hey from controller'; 
    }]); 
} 

내가 직접 app.js 자체 컨트롤러 코드를 작성하는 경우 미세 같은 : weatherModule.controller('WeatherCtrl', ['$scope', function($scope){}])

답변

0

이, 그것은 module.exports 대신 오타 실수를 했어야했다 export

관련 문제