I am a beginner with angular js and I am currently exploring ways to call the service provided in the code snippet below from a controller. The service is defined as follows.
app.factory('myappFactory', ['$http', function($http) {
var data = {};
data.getmyServiceData = function() {
return $http.get('http://..')
}
return data;
}]);
This specific service has already been utilized in one of the existing angular controllers. Now, I am looking to call it from a different controller without actually making another call to the service again. Instead, I want to use the data that was retrieved from the previous request. How can I modify this setup to achieve this and successfully call the factory in a new controller?