2

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 Answer 1

3

You can

var myApp = angular.module('mywidget', ['$scope']);
myApp.controller('TestController', testController);
myApp.controller('Test2Controller', test2Controller);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.