little problem here, i have a controller which communicate with factories, but how can i pass the factory result to a function? Something i tried:
.controller('testCtrl', ['$scope', 'foo', 'boo', function($scope, foo, boo){
foo.get().then(function(response){
$scope.foo = response;
});
boo.get().then(function(response){
$scope.boo = response;
});
// Why this will not work?
function test(){
var getFoo = $scope.foo;
var getBoo = $scope.boo;
};
}]
Example above is not working, how can i get this work?
Thanks.