I have the following controller:
appModule.controller('myController', function($scope, $http)
{
$scope.getObject= function(id)
{
$http.get('/objects/'+id+'.json').success(function (data, status) {
$scope.objects = data;
});
}
});
In my view index.html
<button ng-click="getObject(id)">click</button>
It works fine I get my objects. In another view (home.html) I want to get the 'objects' variable
How can'I do this.
Thanks