I know this has been posted before but I am still confused on how to achieve this for my specific problem.
my first controller:
myApp.controller("buttonCtrl", function($scope){
$scope.johnny = [
{quote: "Anything for My Princess", controller: Princess},
{quote: "Don't Even Ask", controller: DontAsk}];
}
Now I would like to use the $scope.johnny object in this controller:
function Princess($scope){
$scope.play = function(){
//use $scope.johnny.quote or something of the sorts in here
}
}
How would this be done? I have seen posts where $rootScope or services are used; however, how would I implement one in my case.
Thanks a lot.