UNPKG

1.61 kBJavaScriptView Raw
1"use strict";
2/** @publicapi @module ng1 */ /** */
3Object.defineProperty(exports, "__esModule", { value: true });
4exports.$IncludedByStateFilter = exports.$IsStateFilter = void 0;
5var angular_1 = require("./angular");
6/**
7 * `isState` Filter: truthy if the current state is the parameter
8 *
9 * Translates to [[StateService.is]] `$state.is("stateName")`.
10 *
11 * #### Example:
12 * ```html
13 * <div ng-if="'stateName' | isState">show if state is 'stateName'</div>
14 * ```
15 */
16$IsStateFilter.$inject = ['$state'];
17function $IsStateFilter($state) {
18 var isFilter = function (state, params, options) {
19 return $state.is(state, params, options);
20 };
21 isFilter.$stateful = true;
22 return isFilter;
23}
24exports.$IsStateFilter = $IsStateFilter;
25/**
26 * `includedByState` Filter: truthy if the current state includes the parameter
27 *
28 * Translates to [[StateService.includes]]` $state.is("fullOrPartialStateName")`.
29 *
30 * #### Example:
31 * ```html
32 * <div ng-if="'fullOrPartialStateName' | includedByState">show if state includes 'fullOrPartialStateName'</div>
33 * ```
34 */
35$IncludedByStateFilter.$inject = ['$state'];
36function $IncludedByStateFilter($state) {
37 var includesFilter = function (state, params, options) {
38 return $state.includes(state, params, options);
39 };
40 includesFilter.$stateful = true;
41 return includesFilter;
42}
43exports.$IncludedByStateFilter = $IncludedByStateFilter;
44angular_1.ng.module('ui.router.state').filter('isState', $IsStateFilter).filter('includedByState', $IncludedByStateFilter);
45//# sourceMappingURL=stateFilters.js.map
\No newline at end of file