angular how to define multiple controllers
问题 i have code like this angular.module('mywidget', ['$scope']).controller('TestController', testController); I want to add another controller to it ..say ...controller("Test2Controller",Test2Controller) just wanted to know how we can achieve this ? 回答1: You can var myApp = angular.module('mywidget', ['$scope']); myApp.controller('TestController', testController); myApp.controller('Test2Controller', test2Controller); 来源: https://stackoverflow.com/questions/18100755/angular-how-to-define-multiple