I have two controllers and i have to call one controller from another controller.When i called the controller directly i got Error: "$injector:unpr unknown provider".I don't want to create a service or event handling.Is there any simpler way that i can call it?
Below are the controllers:
app.controller('firstCtrl', function($scope) {
$scope.firstName = "John";
$scope.lastName = "Doe";
});
app.controller('secondCtrl',function($scope){
$scope.occupation = "Student";
});
When i called secondCtrl from firstCtrl as below:
***app.controller('firstCtrl', function($scope,secondCtrl) //unknown provider.***