Currently, I am utilizing ui-router in AngularJS as shown below:
.state
('browse.category', {
url: "/:category",
templateUrl: "views/browseCategory.html",
controller: function($stateParams, $scope) {
$scope.params = $stateParams;
}
})
I am seeking a way to make the $stateParams
variable global so that it can be accessed in any view or controller.
At the moment, I am only able to access the parameters within the nested view.