It seems like you are looking to share state between two different views in your application. There are multiple ways to accomplish this, with one option being to use a service.
var app = angular.module('myApp', []);
app.service('myService', function(){
var data;
this.setData = function(d){
data = d;
}
this.getData = function(){
return data;
}
});
app.controller('myCtrl1', function($scope, myService){
$scope.data = myService.getData();
//perform actions
});
app.controller('myCtrl2', function($scope, myService){
$scope.data = myService.getData();
//perform actions
});
Services in Angular are singleton instances that are created once and then stored for future use. By injecting the service into your controllers, you can access the shared data whenever needed.