AngularJs $scope undefined when controllers are inside a module

前端 未结 4 1751
清酒与你
清酒与你 2021-01-30 20:44

I\'m trying to use the angular-seed template with the default settings. In controllers.js I use

angular.module(\'myApp.controllers\', []).
  control         


        
4条回答
  •  醉酒成梦
    2021-01-30 21:16

    This is the proper way:

    angular.module('myApp.controllers', []);
    
    angular.module('myApp.controllers').controller('MyCtrl1', ['$scope', function($scope) {
    
    }]);
    

提交回复
热议问题