angularjs - angular how to define multiple controllers -
i have code
angular.module('mywidget', ['$scope']).controller('testcontroller', testcontroller);
i want add controller ..say ...controller("test2controller",test2controller)
just wanted know how can achieve ?
you can
var myapp = angular.module('mywidget', ['$scope']); myapp.controller('testcontroller', testcontroller); myapp.controller('test2controller', test2controller);
Comments
Post a Comment