I have a locations page that does some stuff and when the end user clicks on a location it will then go to a new page. Im trying to pass some data to the new page using the same controller and scope but on the new page its dropping the scope?
HTML:
<h3 class="fc-primary" ng-click="canvasLocation(location.id)"><a href="/about-us/location">{{location.id}}</a></h3>
Angular Controller:
$scope.canvasLocation = function(locationId) {
angular.forEach($scope.model.canvasLocations.response.locations,
function(value) {
if (value.id === locationId ) {
$scope.model.canvasLocationData.push(value);
var tempArry = [];
tempArry.push(value.institutionName);
tempArry.push(value.latitude);
tempArry.push(value.longitude);
tempArry.push(value.mondayOpen);
tempArry.push(value.mondayClose);
tempArry.push(value.tuesdayOpen);
tempArry.push(value.tuesdayClose);
tempArry.push(value.wednesdayOpen);
tempArry.push(value.wednesdayClose);
tempArry.push(value.thursdayOpen);
tempArry.push(value.thursdayClose);
tempArry.push(value.fridayOpen);
tempArry.push(value.fridayClose);
tempArry.push(value.saturdayOpen);
tempArry.push(value.saturdayClose);
tempArry.push(value.sundayOpen);
tempArry.push(value.sundayClose);
}
});
};
when I try to access $scope.model.canvasLocationData its returning [] on the new page?