I am working with angular router in my application and i have a scenario where i want to show/hide states based on some conditions. My scenario is that
- Show privacy screen if the privacy policy is revised (show terms-changes & terms screen).
- Show terms of use page if the terms of use is revised (show privacy-changes & privacy screens).
- Show both screens if both have changed(show all 4 screens).
JS
angular.module("portal").config(["$stateProvider", "$urlRouterProvider", function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/terms-changes');
$stateProvider
.state('terms-changes', {
url: '/terms-changes',
templateUrl: 'policy/terms-changes.jsp'
}).state('terms', {
url: '/terms',
templateUrl: 'policy/terms-conditions.jsp'
}).state('privacy-changes', {
url: '/privacy-changes',
templateUrl: 'policy/privacy-changes.jsp'
}).state('privacy-policy', {
url: '/privacy-policy',
templateUrl: 'policy/privacy-policy.jsp'
});
}]);
How will i be able to show these screens based on the conditions. i dont want to show the whole screen, say for example if only privacy policy is changed.