So I have a controller that is bound to 2 views. In the controller, I want a scope variable set to:
$scope.isOffset = false;
When another view is routed, I want it set to true. My routes in my app.js is set such as:
$routeProvider.when("/claimSub", {
controller: "claimsController",
templateUrl: "ppt/views/claims/claimSub.html"
});
$routeProvider.when("/offsetSwipe", {
controller: "claimsController",
templateUrl: "ppt/views/swipes/offsetSwipe.html"
});
Both these views also have inputs that are bound to a scope with:
$scope.claimInfo = {
id: "",
benefitId: "",
isSecIns: "",
isNoResid: "",
expenseTypeId: "",
fromDate: "",
toDate: "",
provider: "",
who: "",
depId: "",
age: "",
amount: "",
comments: "",
isOffset: "",
};
So making sure that the second route shown above, this 'isOffset' is the same.
I have not used stateProvider, but not sure that this applies here as one view is not a subset of the other.
So trying to figure what I can do here? Seems to me, but I cannot figure out how, the best route would be to change the routing and add some sort of variable or setter to the app.js for the view I want that variable set to true for.