Sha256: 16ea303838865340b74a533db5ba34a146682156fae86bd4550376d429743098
Contents?: true
Size: 683 Bytes
Versions: 234
Compression:
Stored size: 683 Bytes
Contents
(function () { /** * @ngdoc service * @name Bastion.run:FeatureFlag * * @description * Handles checking if a state is enabled on state change. If the state is disabled, the user * is redirected to a 404 page. */ function FeaturesInit($rootScope, $window, FeatureFlag) { $rootScope.$on('$stateChangeStart', function (event, toState) { if (!FeatureFlag.stateEnabled(toState.name)) { $window.location.href = '/404'; } }); } angular .module('Bastion.features') .run(FeaturesInit); FeaturesInit.$inject = ['$rootScope', '$window', 'FeatureFlag']; })();
Version data entries
234 entries across 234 versions & 2 rubygems