@angular-wave/angular.ts 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/angular-ts.esm.js +1 -1
- package/dist/angular-ts.umd.js +1 -1
- package/index.html +66 -57
- package/package.json +1 -1
- package/rollup.config.js +2 -6
- package/src/animations/animate-children-directive.js +1 -1
- package/src/animations/animate-css-driver.js +1 -1
- package/src/animations/animate-css.js +220 -15
- package/src/animations/animate-js-driver.js +1 -1
- package/src/animations/animate-js.js +2 -2
- package/src/animations/animate-queue.js +3 -4
- package/src/animations/animation.js +1 -1
- package/src/animations/module.js +750 -0
- package/src/animations/shared.js +15 -4
- package/src/core/animate-runner.js +1 -1
- package/src/core/animate.js +4 -5
- package/src/core/compile.js +6 -7
- package/src/core/controller.js +4 -3
- package/src/core/filter.js +1 -1
- package/src/core/interpolate.js +1 -1
- package/src/core/interval-factory.js +1 -1
- package/src/core/interval.js +1 -1
- package/src/core/location.js +1 -1
- package/src/core/parser/parse.js +1 -1
- package/src/core/q.js +2 -3
- package/src/core/root-scope.js +1 -1
- package/src/core/sanitize-uri.js +1 -1
- package/src/core/sce.js +1 -1
- package/src/core/task-tracker-factory.js +1 -1
- package/src/core/timeout.js +1 -1
- package/src/core/urlUtils.js +1 -1
- package/src/directive/attrs.js +1 -1
- package/src/directive/bind.js +1 -1
- package/src/directive/class.js +2 -2
- package/src/directive/events.js +1 -1
- package/src/directive/form.js +1 -1
- package/src/directive/include.js +1 -1
- package/src/directive/input.js +1 -1
- package/src/directive/list.js +2 -2
- package/src/directive/model-options.js +1 -1
- package/src/directive/model.js +1 -1
- package/src/directive/options.js +2 -3
- package/src/directive/ref.js +1 -1
- package/src/directive/repeat.js +1 -1
- package/src/directive/select.js +1 -1
- package/src/directive/switch.js +1 -1
- package/src/directive/transclude.js +1 -1
- package/src/directive/validators.js +1 -1
- package/src/exts/aria.js +1 -1
- package/src/exts/messages.js +3 -3
- package/src/exts/messages.md +28 -31
- package/src/filters/filter.js +2 -3
- package/src/filters/filters.js +1 -1
- package/src/filters/limit-to.js +1 -1
- package/src/filters/order-by.js +2 -3
- package/src/injector.js +8 -9
- package/src/jqLite.js +3 -4
- package/src/loader.js +1 -3
- package/src/public.js +1 -1
- package/src/router/common/coreservices.js +5 -0
- package/src/router/{core/common → common}/queue.js +1 -1
- package/src/router/{core/common → common}/trace.js +21 -19
- package/src/router/{adapter/directives → directives}/stateDirectives.js +24 -28
- package/src/router/{adapter/directives → directives}/viewDirective.js +10 -9
- package/src/router/{core/globals.js → globals.js} +13 -3
- package/src/router/{core/hooks → hooks}/coreResolvables.js +6 -4
- package/src/router/{core/hooks → hooks}/lazyLoad.js +5 -2
- package/src/router/{core/hooks → hooks}/redirectTo.js +1 -1
- package/src/router/{core/hooks → hooks}/resolve.js +5 -4
- package/src/router/{core/hooks → hooks}/updateGlobals.js +1 -1
- package/src/router/{core/hooks → hooks}/views.js +2 -3
- package/src/router/index.js +60 -0
- package/src/router/{adapter/injectables.js → injectables.js} +9 -9
- package/src/router/{adapter/locationServices.js → locationServices.js} +19 -12
- package/src/router/{core/params → params}/param.js +5 -10
- package/src/router/{core/params → params}/paramType.js +4 -4
- package/src/router/{core/params → params}/paramTypes.js +4 -3
- package/src/router/{core/params → params}/stateParams.js +1 -1
- package/src/router/{core/path → path}/pathNode.js +2 -2
- package/src/router/{core/path → path}/pathUtils.js +13 -7
- package/src/router/{core/resolve → resolve}/resolvable.js +5 -5
- package/src/router/{core/resolve → resolve}/resolveContext.js +16 -6
- package/src/router/router.js +171 -72
- package/src/router/{adapter/services.js → services.js} +47 -27
- package/src/router/{core/state → state}/stateBuilder.js +14 -10
- package/src/router/{core/state → state}/stateMatcher.js +2 -3
- package/src/router/{core/state → state}/stateObject.js +8 -6
- package/src/router/{core/state → state}/stateQueueManager.js +3 -3
- package/src/router/{core/state → state}/stateRegistry.js +6 -7
- package/src/router/{core/state → state}/stateService.js +12 -15
- package/src/router/{core/state → state}/targetState.js +2 -2
- package/src/router/{adapter/statebuilders → state}/views.js +17 -15
- package/src/router/{adapter/stateProvider.js → stateProvider.js} +52 -9
- package/src/router/{adapter/templateFactory.js → templateFactory.js} +10 -19
- package/src/router/{core/transition → transition}/hookBuilder.js +4 -3
- package/src/router/{core/transition → transition}/hookRegistry.js +3 -6
- package/src/router/{core/transition → transition}/rejectFactory.js +4 -5
- package/src/router/{core/transition → transition}/transition.js +10 -12
- package/src/router/{core/transition → transition}/transitionHook.js +4 -4
- package/src/router/{core/transition → transition}/transitionService.js +13 -13
- package/src/router/{core/url → url}/urlConfig.js +28 -19
- package/src/router/{core/url → url}/urlMatcher.js +14 -16
- package/src/router/{core/url → url}/urlMatcherFactory.js +7 -6
- package/src/router/{core/url → url}/urlRouter.js +6 -30
- package/src/router/{core/url → url}/urlRule.js +3 -3
- package/src/router/{core/url → url}/urlRules.js +10 -11
- package/src/router/{core/url → url}/urlService.js +12 -6
- package/src/router/{core/view → view}/view.js +32 -27
- package/src/router/{adapter/viewScroll.js → viewScroll.js} +3 -0
- package/src/services/anchor-scroll.js +1 -1
- package/src/services/browser.js +1 -1
- package/src/services/cache-factory.js +7 -1
- package/src/services/cookie-reader.js +1 -1
- package/src/services/http-backend.js +6 -1
- package/src/services/http.js +4 -5
- package/src/services/log.js +1 -1
- package/src/services/template-request.js +2 -2
- package/src/{router/core/common → shared}/common.js +35 -16
- package/src/{router/core/common → shared}/predicates.js +2 -12
- package/src/{router/core/common → shared}/strings.js +5 -13
- package/src/{core → shared}/utils.js +13 -29
- package/test/angular.spec.js +1 -31
- package/test/{ng → core}/animate.spec.js +1 -1
- package/test/{ng → core}/compile.spec.js +2 -3
- package/test/{ng → core}/http.spec.js +2 -2
- package/test/{ng → core}/on.spec.js +1 -1
- package/test/{ng → core}/parse.spec.js +1 -1
- package/test/{ng → core}/prop.spec.js +1 -1
- package/test/{ng → core}/scope.spec.js +1 -1
- package/test/{ng/directive → directive}/a.spec.js +4 -4
- package/test/{ng/directive → directive}/bind.spec.js +3 -3
- package/test/{ng/directive → directive}/boolean.spec.js +2 -2
- package/test/{ng/directive → directive}/change.spec.js +3 -3
- package/test/{ng/directive → directive}/class.spec.js +4 -4
- package/test/{ng/directive → directive}/click.spec.js +3 -3
- package/test/{ng/directive → directive}/cloak.spec.js +4 -4
- package/test/{ng/directive → directive}/constoller.spec.js +5 -5
- package/test/{ng/directive → directive}/element-style.spec.js +3 -3
- package/test/{ng/directive → directive}/event.spec.js +4 -4
- package/test/{ng/directive → directive}/form.spec.js +5 -5
- package/test/{ng/directive → directive}/href.spec.js +4 -4
- package/test/{ng/directive → directive}/if.spec.js +5 -5
- package/test/{ng/directive → directive}/include.spec.js +5 -5
- package/test/{ng/directive → directive}/init.spec.js +4 -4
- package/test/{ng/directive → directive}/input.spec.js +5 -5
- package/test/{ng/directive → directive}/list.spec.js +3 -3
- package/test/{ng/directive → directive}/model-options.spec.js +6 -6
- package/test/{ng/directive → directive}/model.spec.js +8 -8
- package/test/{ng/directive → directive}/non-bindable.spec.js +3 -3
- package/test/{ng/directive → directive}/options.spec.js +5 -5
- package/test/{ng/directive → directive}/ref.spec.js +2 -2
- package/test/{ng/directive → directive}/repeat.spec.js +5 -5
- package/test/{ng/directive → directive}/script.spec.js +3 -3
- package/test/{ng/directive → directive}/scrset.spec.js +3 -3
- package/test/{ng/directive → directive}/select.spec.js +5 -5
- package/test/{ng/directive → directive}/show-hide.spec.js +3 -3
- package/test/{ng/directive → directive}/src.spec.js +3 -3
- package/test/{ng/directive → directive}/style.spec.js +3 -3
- package/test/{ng/directive → directive}/switch.spec.js +3 -3
- package/test/{ng/directive → directive}/validators.spec.js +3 -3
- package/test/{ng/filter → filter}/filter.spec.js +4 -4
- package/test/{ng/filter → filter}/filters.spec.js +3 -3
- package/test/{ng/filter → filter}/limit-to.spec.js +3 -3
- package/test/{ng/filter → filter}/order-by.spec.js +2 -2
- package/test/injector.spec.js +1 -1
- package/test/jqlite.spec.js +1 -1
- package/test/messages/messages.spec.js +1 -1
- package/test/min-err.spec.js +1 -1
- package/test/original-test.html +4 -4
- package/test/router/glob.spec.js +78 -0
- package/test/router/state.spec.js +931 -0
- package/test/sanitize/bing-html.spec.js +1 -1
- package/test/shared/common.spec.js +283 -0
- package/test/shared/hof.spec.js +60 -0
- package/test/shared/strings.spec.js +40 -0
- package/test/{ng → shared}/utils.spec.js +1 -1
- package/types/router/angular.d.ts +1 -0
- package/types/router/core/common/common.d.ts +370 -0
- package/types/router/core/common/coreservices.d.ts +80 -0
- package/types/router/core/common/glob.d.ts +60 -0
- package/types/router/core/common/hof.d.ts +160 -0
- package/types/router/core/common/index.d.ts +8 -0
- package/types/router/core/common/predicates.d.ts +25 -0
- package/types/router/core/common/queue.d.ts +15 -0
- package/types/router/core/common/safeConsole.d.ts +5 -0
- package/types/router/core/common/strings.d.ts +64 -0
- package/types/router/core/common/trace.d.ts +114 -0
- package/types/router/core/globals.d.ts +45 -0
- package/types/router/core/hooks/coreResolvables.d.ts +4 -0
- package/types/router/core/hooks/ignoredTransition.d.ts +2 -0
- package/types/router/core/hooks/invalidTransition.d.ts +2 -0
- package/types/router/core/hooks/lazyLoad.d.ts +12 -0
- package/types/router/core/hooks/onEnterExitRetain.d.ts +4 -0
- package/types/router/core/hooks/redirectTo.d.ts +2 -0
- package/types/router/core/hooks/resolve.d.ts +5 -0
- package/types/router/core/hooks/updateGlobals.d.ts +2 -0
- package/types/router/core/hooks/url.d.ts +2 -0
- package/types/router/core/hooks/views.d.ts +3 -0
- package/types/router/core/index.d.ts +12 -0
- package/types/router/core/interface.d.ts +102 -0
- package/types/router/core/params/index.d.ts +12 -0
- package/types/router/core/params/interface.d.ts +606 -0
- package/types/router/core/params/param.d.ts +65 -0
- package/types/router/core/params/paramType.d.ts +65 -0
- package/types/router/core/params/paramTypes.d.ts +190 -0
- package/types/router/core/params/stateParams.d.ts +15 -0
- package/types/router/core/path/index.d.ts +2 -0
- package/types/router/core/path/pathNode.d.ts +60 -0
- package/types/router/core/path/pathUtils.d.ts +79 -0
- package/types/router/core/resolve/index.d.ts +3 -0
- package/types/router/core/resolve/interface.d.ts +210 -0
- package/types/router/core/resolve/resolvable.d.ts +69 -0
- package/types/router/core/resolve/resolveContext.d.ts +92 -0
- package/types/router/core/router.d.ts +95 -0
- package/types/router/core/state/index.d.ts +28 -0
- package/types/router/core/state/interface.d.ts +708 -0
- package/types/router/core/state/stateBuilder.d.ts +104 -0
- package/types/router/core/state/stateMatcher.d.ts +11 -0
- package/types/router/core/state/stateObject.d.ts +155 -0
- package/types/router/core/state/stateQueueManager.d.ts +24 -0
- package/types/router/core/state/stateRegistry.d.ts +136 -0
- package/types/router/core/state/stateService.d.ts +350 -0
- package/types/router/core/state/targetState.d.ts +100 -0
- package/types/router/core/transition/hookBuilder.d.ts +45 -0
- package/types/router/core/transition/hookRegistry.d.ts +93 -0
- package/types/router/core/transition/index.d.ts +20 -0
- package/types/router/core/transition/interface.d.ts +819 -0
- package/types/router/core/transition/rejectFactory.d.ts +103 -0
- package/types/router/core/transition/transition.d.ts +527 -0
- package/types/router/core/transition/transitionEventType.d.ts +17 -0
- package/types/router/core/transition/transitionHook.d.ts +88 -0
- package/types/router/core/transition/transitionService.d.ts +187 -0
- package/types/router/core/url/index.d.ts +8 -0
- package/types/router/core/url/interface.d.ts +156 -0
- package/types/router/core/url/urlConfig.d.ts +141 -0
- package/types/router/core/url/urlMatcher.d.ts +180 -0
- package/types/router/core/url/urlMatcherFactory.d.ts +52 -0
- package/types/router/core/url/urlRouter.d.ts +85 -0
- package/types/router/core/url/urlRule.d.ts +120 -0
- package/types/router/core/url/urlRules.d.ts +244 -0
- package/types/router/core/url/urlService.d.ts +206 -0
- package/types/router/core/vanilla.d.ts +1 -0
- package/types/router/core/view/index.d.ts +2 -0
- package/types/router/core/view/interface.d.ts +46 -0
- package/types/router/core/view/view.d.ts +167 -0
- package/types/router/directives/stateDirectives.d.ts +3 -0
- package/types/router/directives/viewDirective.d.ts +143 -0
- package/types/router/index.d.ts +19 -0
- package/types/router/interface.d.ts +491 -0
- package/types/router/legacy/resolveService.d.ts +44 -0
- package/types/router/legacy/stateEvents.d.ts +123 -0
- package/types/router/locationServices.d.ts +43 -0
- package/types/router/services.d.ts +15 -0
- package/types/router/stateFilters.d.ts +11 -0
- package/types/router/stateProvider.d.ts +254 -0
- package/types/router/statebuilders/onEnterExitRetain.d.ts +12 -0
- package/types/router/statebuilders/views.d.ts +41 -0
- package/types/router/templateFactory.d.ts +84 -0
- package/types/router/viewScroll.d.ts +9 -0
- package/src/animations/animate.css.md +0 -263
- package/src/animations/animate.md +0 -933
- package/src/router/adapter/statebuilders/onEnterExitRetain.js +0 -29
- package/src/router/core/common/coreservices.js +0 -15
- package/src/router/core/common/safeConsole.js +0 -37
- package/src/router/core/interface.js +0 -3
- package/src/router/core/resolve/interface.js +0 -10
- package/src/router/core/router.js +0 -203
- package/src/router/core/url/interface.js +0 -1
- package/src/router/core/view/interface.js +0 -1
- /package/src/router/{core/common → common}/glob.js +0 -0
- /package/src/router/{core/hooks → hooks}/ignoredTransition.js +0 -0
- /package/src/router/{core/hooks → hooks}/invalidTransition.js +0 -0
- /package/src/router/{core/hooks → hooks}/onEnterExitRetain.js +0 -0
- /package/src/router/{core/hooks → hooks}/url.js +0 -0
- /package/src/router/{core/params → params}/README.md +0 -0
- /package/src/router/{core/state → state}/README.md +0 -0
- /package/src/router/{adapter/stateFilters.js → stateFilters.js} +0 -0
- /package/src/router/{core/transition → transition}/interface.js +0 -0
- /package/src/router/{core/transition → transition}/transitionEventType.js +0 -0
- /package/src/{router/core/common → shared}/hof.js +0 -0
- /package/test/{ng → core}/cache-factor.spec.js +0 -0
- /package/test/{ng → core}/controller-provider.spec.js +0 -0
- /package/test/{ng → core}/cookie-reader.spec.js +0 -0
- /package/test/{ng → core}/document.spec.js +0 -0
- /package/test/{ng → core}/filter.spec.js +0 -0
- /package/test/{ng → core}/http-backend.spec.js +0 -0
- /package/test/{ng → core}/interpolate.spec.js +0 -0
- /package/test/{ng → core}/interval.spec.js +0 -0
- /package/test/{ng → core}/location.spec.js +0 -0
- /package/test/{ng → core}/q.spec.js +0 -0
- /package/test/{ng → core}/root-element.spec.js +0 -0
- /package/test/{ng → core}/sanitize-uri.spec.js +0 -0
- /package/test/{ng → core}/sce.spec.js +0 -0
- /package/test/{ng → core}/template-request.spec.js +0 -0
- /package/test/{ng → core}/timeout.spec.js +0 -0
- /package/test/{ng → core}/url-utils.spec.js +0 -0
- /package/{src/router/adapter/interface.js → types/router/injectables.d.ts} +0 -0
package/src/injector.js
CHANGED
|
@@ -2,7 +2,6 @@ import {
|
|
|
2
2
|
assertArgFn,
|
|
3
3
|
minErr,
|
|
4
4
|
forEach,
|
|
5
|
-
isArray,
|
|
6
5
|
isFunction,
|
|
7
6
|
isString,
|
|
8
7
|
createMap,
|
|
@@ -14,7 +13,7 @@ import {
|
|
|
14
13
|
reverseParams,
|
|
15
14
|
isObject,
|
|
16
15
|
isDefined,
|
|
17
|
-
} from "./
|
|
16
|
+
} from "./shared/utils";
|
|
18
17
|
|
|
19
18
|
var ARROW_ARG = /^([^(]+?)=>/;
|
|
20
19
|
var FN_ARGS = /^[^(]*\(\s*([^)]*)\)/m;
|
|
@@ -69,7 +68,7 @@ function annotate(fn, strictDi, name) {
|
|
|
69
68
|
}
|
|
70
69
|
fn.$inject = $inject;
|
|
71
70
|
}
|
|
72
|
-
} else if (isArray(fn)) {
|
|
71
|
+
} else if (Array.isArray(fn)) {
|
|
73
72
|
last = fn.length - 1;
|
|
74
73
|
assertArgFn(fn[last], "fn");
|
|
75
74
|
$inject = fn.slice(0, last);
|
|
@@ -163,7 +162,7 @@ export function createInjector(modulesToLoad, strictDi) {
|
|
|
163
162
|
|
|
164
163
|
function provider(name, provider_) {
|
|
165
164
|
assertNotHasOwnProperty(name, "service");
|
|
166
|
-
if (isFunction(provider_) || isArray(provider_)) {
|
|
165
|
+
if (isFunction(provider_) || Array.isArray(provider_)) {
|
|
167
166
|
provider_ = providerInjector.instantiate(provider_);
|
|
168
167
|
}
|
|
169
168
|
if (!provider_.$get) {
|
|
@@ -232,7 +231,7 @@ export function createInjector(modulesToLoad, strictDi) {
|
|
|
232
231
|
////////////////////////////////////
|
|
233
232
|
function loadModules(modulesToLoad) {
|
|
234
233
|
assertArg(
|
|
235
|
-
isUndefined(modulesToLoad) || isArray(modulesToLoad),
|
|
234
|
+
isUndefined(modulesToLoad) || Array.isArray(modulesToLoad),
|
|
236
235
|
"modulesToLoad",
|
|
237
236
|
"not an array",
|
|
238
237
|
);
|
|
@@ -263,13 +262,13 @@ export function createInjector(modulesToLoad, strictDi) {
|
|
|
263
262
|
runInvokeQueue(moduleFn._configBlocks);
|
|
264
263
|
} else if (isFunction(module)) {
|
|
265
264
|
runBlocks.push(providerInjector.invoke(module));
|
|
266
|
-
} else if (isArray(module)) {
|
|
265
|
+
} else if (Array.isArray(module)) {
|
|
267
266
|
runBlocks.push(providerInjector.invoke(module));
|
|
268
267
|
} else {
|
|
269
268
|
assertArgFn(module, "module");
|
|
270
269
|
}
|
|
271
270
|
} catch (e) {
|
|
272
|
-
if (isArray(module)) {
|
|
271
|
+
if (Array.isArray(module)) {
|
|
273
272
|
module = module[module.length - 1];
|
|
274
273
|
}
|
|
275
274
|
if (e.message && e.stack && e.stack.indexOf(e.message) === -1) {
|
|
@@ -359,7 +358,7 @@ export function createInjector(modulesToLoad, strictDi) {
|
|
|
359
358
|
}
|
|
360
359
|
|
|
361
360
|
const args = injectionArgs(fn, locals, serviceName);
|
|
362
|
-
if (isArray(fn)) {
|
|
361
|
+
if (Array.isArray(fn)) {
|
|
363
362
|
fn = fn[fn.length - 1];
|
|
364
363
|
}
|
|
365
364
|
|
|
@@ -375,7 +374,7 @@ export function createInjector(modulesToLoad, strictDi) {
|
|
|
375
374
|
function instantiate(Type, locals, serviceName) {
|
|
376
375
|
// Check if Type is annotated and use just the given function at n-1 as parameter
|
|
377
376
|
// e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]);
|
|
378
|
-
const ctor = isArray(Type) ? Type[Type.length - 1] : Type;
|
|
377
|
+
const ctor = Array.isArray(Type) ? Type[Type.length - 1] : Type;
|
|
379
378
|
const args = injectionArgs(Type, locals, serviceName);
|
|
380
379
|
// Empty object at position 0 is ignored for invocation with `new`, but required.
|
|
381
380
|
args.unshift(null);
|
package/src/jqLite.js
CHANGED
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
concat,
|
|
5
5
|
extend,
|
|
6
6
|
forEach,
|
|
7
|
-
isArray,
|
|
8
7
|
isDefined,
|
|
9
8
|
isFunction,
|
|
10
9
|
isObject,
|
|
@@ -14,7 +13,7 @@ import {
|
|
|
14
13
|
nodeName_,
|
|
15
14
|
shallowCopy,
|
|
16
15
|
trim,
|
|
17
|
-
} from "./
|
|
16
|
+
} from "./shared/utils";
|
|
18
17
|
import { CACHE, EXPANDO } from "./core/cache";
|
|
19
18
|
|
|
20
19
|
/**
|
|
@@ -340,7 +339,7 @@ function jqLiteOff(element, type, fn, unsupported) {
|
|
|
340
339
|
} else {
|
|
341
340
|
const removeHandler = function (type) {
|
|
342
341
|
const listenerFns = events[type];
|
|
343
|
-
if (isDefined(fn) && isArray(listenerFns)) {
|
|
342
|
+
if (isDefined(fn) && Array.isArray(listenerFns)) {
|
|
344
343
|
arrayRemove(listenerFns, fn);
|
|
345
344
|
}
|
|
346
345
|
if (!(isDefined(fn) && listenerFns && listenerFns.length > 0)) {
|
|
@@ -473,7 +472,7 @@ function jqLiteInheritedData(element, name, value) {
|
|
|
473
472
|
if (element.nodeType === Node.DOCUMENT_NODE) {
|
|
474
473
|
element = element.documentElement;
|
|
475
474
|
}
|
|
476
|
-
const names = isArray(name) ? name : [name];
|
|
475
|
+
const names = Array.isArray(name) ? name : [name];
|
|
477
476
|
|
|
478
477
|
while (element) {
|
|
479
478
|
for (let i = 0, ii = names.length; i < ii; i++) {
|
package/src/loader.js
CHANGED
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
isObject,
|
|
8
8
|
ngAttrPrefixes,
|
|
9
9
|
isDefined,
|
|
10
|
-
isArray,
|
|
11
10
|
isDate,
|
|
12
11
|
isElement,
|
|
13
12
|
isNumber,
|
|
@@ -23,7 +22,7 @@ import {
|
|
|
23
22
|
isBoolean,
|
|
24
23
|
isValidObjectMaxDepth,
|
|
25
24
|
minErrConfig,
|
|
26
|
-
} from "./
|
|
25
|
+
} from "./shared/utils";
|
|
27
26
|
import { jqLite, startingTag } from "./jqLite";
|
|
28
27
|
import { createInjector } from "./injector";
|
|
29
28
|
import { CACHE } from "./core/cache";
|
|
@@ -57,7 +56,6 @@ export class Angular {
|
|
|
57
56
|
this.fromJson = fromJson;
|
|
58
57
|
this.toJson = toJson;
|
|
59
58
|
this.identity = identity;
|
|
60
|
-
this.isArray = isArray;
|
|
61
59
|
this.isDate = isDate;
|
|
62
60
|
this.isDefined = isDefined;
|
|
63
61
|
this.isElement = isElement;
|
package/src/public.js
CHANGED
|
@@ -100,7 +100,7 @@ import { setupModuleLoader } from "./loader";
|
|
|
100
100
|
import { initAnimateModule } from "./animations/module";
|
|
101
101
|
import { initMessageModule } from "./exts/messages";
|
|
102
102
|
import { initAriaModule } from "./exts/aria";
|
|
103
|
-
import { initRouter } from "./router/
|
|
103
|
+
import { initRouter } from "./router/index";
|
|
104
104
|
|
|
105
105
|
export function publishExternalAPI() {
|
|
106
106
|
const module = setupModuleLoader(window);
|
|
@@ -32,10 +32,14 @@
|
|
|
32
32
|
*
|
|
33
33
|
* @packageDocumentation
|
|
34
34
|
*/
|
|
35
|
-
import { parse } from "
|
|
36
|
-
import { isNumber } from "
|
|
37
|
-
import {
|
|
38
|
-
|
|
35
|
+
import { parse } from "../../shared/hof";
|
|
36
|
+
import { isNumber } from "../../shared/utils";
|
|
37
|
+
import {
|
|
38
|
+
stringify,
|
|
39
|
+
functionToString,
|
|
40
|
+
maxLength,
|
|
41
|
+
padString,
|
|
42
|
+
} from "../../shared/strings";
|
|
39
43
|
function uiViewString(uiview) {
|
|
40
44
|
if (!uiview) return "ui-view (defunct)";
|
|
41
45
|
const state = uiview.creationContext
|
|
@@ -80,13 +84,11 @@ const transLbl = (trans) => `Transition #${_tid(trans)}-${_rid(trans)}`;
|
|
|
80
84
|
* Prints UI-Router Transition trace information to the console.
|
|
81
85
|
*/
|
|
82
86
|
export class Trace {
|
|
83
|
-
/** @internal */
|
|
84
87
|
constructor() {
|
|
85
|
-
/** @internal */
|
|
86
88
|
this._enabled = {};
|
|
87
89
|
this.approximateDigests = 0;
|
|
88
90
|
}
|
|
89
|
-
|
|
91
|
+
|
|
90
92
|
_set(enabled, categories) {
|
|
91
93
|
if (!categories.length) {
|
|
92
94
|
categories = Object.keys(Category)
|
|
@@ -119,12 +121,12 @@ export class Trace {
|
|
|
119
121
|
/** @internal called by ui-router code */
|
|
120
122
|
traceTransitionStart(trans) {
|
|
121
123
|
if (!this.enabled(Category.TRANSITION)) return;
|
|
122
|
-
|
|
124
|
+
console.log(`${transLbl(trans)}: Started -> ${stringify(trans)}`);
|
|
123
125
|
}
|
|
124
126
|
/** @internal called by ui-router code */
|
|
125
127
|
traceTransitionIgnored(trans) {
|
|
126
128
|
if (!this.enabled(Category.TRANSITION)) return;
|
|
127
|
-
|
|
129
|
+
console.log(`${transLbl(trans)}: Ignored <> ${stringify(trans)}`);
|
|
128
130
|
}
|
|
129
131
|
/** @internal called by ui-router code */
|
|
130
132
|
traceHookInvocation(step, trans, options) {
|
|
@@ -135,47 +137,47 @@ export class Trace {
|
|
|
135
137
|
parse("traceData.context")(options) ||
|
|
136
138
|
"unknown",
|
|
137
139
|
name = functionToString(step.registeredHook.callback);
|
|
138
|
-
|
|
140
|
+
console.log(
|
|
139
141
|
`${transLbl(trans)}: Hook -> ${event} context: ${context}, ${maxLength(200, name)}`,
|
|
140
142
|
);
|
|
141
143
|
}
|
|
142
144
|
/** @internal called by ui-router code */
|
|
143
145
|
traceHookResult(hookResult, trans, transitionOptions) {
|
|
144
146
|
if (!this.enabled(Category.HOOK)) return;
|
|
145
|
-
|
|
147
|
+
console.log(
|
|
146
148
|
`${transLbl(trans)}: <- Hook returned: ${maxLength(200, stringify(hookResult))}`,
|
|
147
149
|
);
|
|
148
150
|
}
|
|
149
151
|
/** @internal called by ui-router code */
|
|
150
152
|
traceResolvePath(path, when, trans) {
|
|
151
153
|
if (!this.enabled(Category.RESOLVE)) return;
|
|
152
|
-
|
|
154
|
+
console.log(`${transLbl(trans)}: Resolving ${path} (${when})`);
|
|
153
155
|
}
|
|
154
156
|
/** @internal called by ui-router code */
|
|
155
157
|
traceResolvableResolved(resolvable, trans) {
|
|
156
158
|
if (!this.enabled(Category.RESOLVE)) return;
|
|
157
|
-
|
|
159
|
+
console.log(
|
|
158
160
|
`${transLbl(trans)}: <- Resolved ${resolvable} to: ${maxLength(200, stringify(resolvable.data))}`,
|
|
159
161
|
);
|
|
160
162
|
}
|
|
161
163
|
/** @internal called by ui-router code */
|
|
162
164
|
traceError(reason, trans) {
|
|
163
165
|
if (!this.enabled(Category.TRANSITION)) return;
|
|
164
|
-
|
|
166
|
+
console.log(
|
|
165
167
|
`${transLbl(trans)}: <- Rejected ${stringify(trans)}, reason: ${reason}`,
|
|
166
168
|
);
|
|
167
169
|
}
|
|
168
170
|
/** @internal called by ui-router code */
|
|
169
171
|
traceSuccess(finalState, trans) {
|
|
170
172
|
if (!this.enabled(Category.TRANSITION)) return;
|
|
171
|
-
|
|
173
|
+
console.log(
|
|
172
174
|
`${transLbl(trans)}: <- Success ${stringify(trans)}, final state: ${finalState.name}`,
|
|
173
175
|
);
|
|
174
176
|
}
|
|
175
177
|
/** @internal called by ui-router code */
|
|
176
178
|
traceUIViewEvent(event, viewData, extra = "") {
|
|
177
179
|
if (!this.enabled(Category.UIVIEW)) return;
|
|
178
|
-
|
|
180
|
+
console.log(
|
|
179
181
|
`ui-view: ${padString(30, event)} ${uiViewString(viewData)}${extra}`,
|
|
180
182
|
);
|
|
181
183
|
}
|
|
@@ -207,17 +209,17 @@ export class Trace {
|
|
|
207
209
|
return { [uivheader]: uiv, [cfgheader]: cfg };
|
|
208
210
|
})
|
|
209
211
|
.sort((a, b) => (a[uivheader] || "").localeCompare(b[uivheader] || ""));
|
|
210
|
-
|
|
212
|
+
console.table(mapping);
|
|
211
213
|
}
|
|
212
214
|
/** @internal called by ui-router code */
|
|
213
215
|
traceViewServiceEvent(event, viewConfig) {
|
|
214
216
|
if (!this.enabled(Category.VIEWCONFIG)) return;
|
|
215
|
-
|
|
217
|
+
console.log(`VIEWCONFIG: ${event} ${viewConfigString(viewConfig)}`);
|
|
216
218
|
}
|
|
217
219
|
/** @internal called by ui-router code */
|
|
218
220
|
traceViewServiceUIViewEvent(event, viewData) {
|
|
219
221
|
if (!this.enabled(Category.VIEWCONFIG)) return;
|
|
220
|
-
|
|
222
|
+
console.log(`VIEWCONFIG: ${event} ${uiViewString(viewData)}`);
|
|
221
223
|
}
|
|
222
224
|
}
|
|
223
225
|
/**
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
uniqR,
|
|
15
15
|
inArray,
|
|
16
16
|
removeFrom,
|
|
17
|
-
} from "../../
|
|
18
|
-
import { isString, isObject
|
|
17
|
+
} from "../../shared/common";
|
|
18
|
+
import { isString, isObject } from "../../shared/utils";
|
|
19
19
|
|
|
20
|
-
import { parse } from "../../
|
|
20
|
+
import { parse } from "../../shared/hof";
|
|
21
21
|
/** @hidden */
|
|
22
22
|
function parseStateRef(ref) {
|
|
23
23
|
const paramsOnly = ref.match(/^\s*({[^}]*})\s*$/);
|
|
@@ -102,7 +102,7 @@ function bindEvents(element, scope, hookFn, uiStateOpts) {
|
|
|
102
102
|
if (uiStateOpts) {
|
|
103
103
|
events = uiStateOpts.events;
|
|
104
104
|
}
|
|
105
|
-
if (!isArray(events)) {
|
|
105
|
+
if (!Array.isArray(events)) {
|
|
106
106
|
events = ["click"];
|
|
107
107
|
}
|
|
108
108
|
const on = element.on ? "on" : "bind";
|
|
@@ -250,10 +250,10 @@ function bindEvents(element, scope, hookFn, uiStateOpts) {
|
|
|
250
250
|
* If you need to dynamically update the state being linked to, use the fully dynamic [[uiState]] directive.
|
|
251
251
|
*/
|
|
252
252
|
export let uiSrefDirective = [
|
|
253
|
-
"$
|
|
253
|
+
"$router",
|
|
254
254
|
"$timeout",
|
|
255
|
-
function $StateRefDirective($
|
|
256
|
-
const $state = $
|
|
255
|
+
function $StateRefDirective($router, $timeout) {
|
|
256
|
+
const $state = $router.stateService;
|
|
257
257
|
return {
|
|
258
258
|
restrict: "A",
|
|
259
259
|
require: ["?^uiSrefActive", "?^uiSrefActiveEq"],
|
|
@@ -290,11 +290,8 @@ export let uiSrefDirective = [
|
|
|
290
290
|
rawDef.uiStateParams = Object.assign({}, scope.$eval(ref.paramExpr));
|
|
291
291
|
}
|
|
292
292
|
update();
|
|
293
|
-
scope.$on("$destroy", $
|
|
294
|
-
scope.$on(
|
|
295
|
-
"$destroy",
|
|
296
|
-
$uiRouter.transitionService.onSuccess({}, update),
|
|
297
|
-
);
|
|
293
|
+
scope.$on("$destroy", $router.stateRegistry.onStatesChanged(update));
|
|
294
|
+
scope.$on("$destroy", $router.transitionService.onSuccess({}, update));
|
|
298
295
|
if (!type.clickable) return;
|
|
299
296
|
const hookFn = clickHook(element, $state, $timeout, type, getDef);
|
|
300
297
|
bindEvents(element, scope, hookFn, rawDef.uiStateOpts);
|
|
@@ -387,10 +384,10 @@ export let uiSrefDirective = [
|
|
|
387
384
|
* ```
|
|
388
385
|
*/
|
|
389
386
|
export let uiStateDirective = [
|
|
390
|
-
"$
|
|
387
|
+
"$router",
|
|
391
388
|
"$timeout",
|
|
392
|
-
function $StateRefDynamicDirective($
|
|
393
|
-
const $state = $
|
|
389
|
+
function $StateRefDynamicDirective($router, $timeout) {
|
|
390
|
+
const $state = $router.stateService;
|
|
394
391
|
return {
|
|
395
392
|
restrict: "A",
|
|
396
393
|
require: ["?^uiSrefActive", "?^uiSrefActiveEq"],
|
|
@@ -431,11 +428,8 @@ export let uiStateDirective = [
|
|
|
431
428
|
});
|
|
432
429
|
});
|
|
433
430
|
update();
|
|
434
|
-
scope.$on("$destroy", $
|
|
435
|
-
scope.$on(
|
|
436
|
-
"$destroy",
|
|
437
|
-
$uiRouter.transitionService.onSuccess({}, update),
|
|
438
|
-
);
|
|
431
|
+
scope.$on("$destroy", $router.stateRegistry.onStatesChanged(update));
|
|
432
|
+
scope.$on("$destroy", $router.transitionService.onSuccess({}, update));
|
|
439
433
|
if (!type.clickable) return;
|
|
440
434
|
hookFn = clickHook(element, $state, $timeout, type, getDef);
|
|
441
435
|
bindEvents(element, scope, hookFn, rawDef.uiStateOpts);
|
|
@@ -539,12 +533,12 @@ export let uiSrefActiveDirective = [
|
|
|
539
533
|
"$state",
|
|
540
534
|
"$stateParams",
|
|
541
535
|
"$interpolate",
|
|
542
|
-
"$
|
|
536
|
+
"$router",
|
|
543
537
|
function $StateRefActiveDirective(
|
|
544
538
|
$state,
|
|
545
539
|
$stateParams,
|
|
546
540
|
$interpolate,
|
|
547
|
-
$
|
|
541
|
+
$router,
|
|
548
542
|
) {
|
|
549
543
|
return {
|
|
550
544
|
restrict: "A",
|
|
@@ -588,14 +582,16 @@ export let uiSrefActiveDirective = [
|
|
|
588
582
|
trans.promise.then(update, noop);
|
|
589
583
|
}
|
|
590
584
|
$scope.$on("$destroy", setupEventListeners());
|
|
591
|
-
if ($
|
|
592
|
-
updateAfterTransition($
|
|
585
|
+
if ($router.globals.transition) {
|
|
586
|
+
updateAfterTransition($router.globals.transition);
|
|
593
587
|
}
|
|
594
588
|
function setupEventListeners() {
|
|
595
589
|
const deregisterStatesChangedListener =
|
|
596
|
-
$
|
|
597
|
-
const deregisterOnStartListener =
|
|
598
|
-
|
|
590
|
+
$router.stateRegistry.onStatesChanged(handleStatesChanged);
|
|
591
|
+
const deregisterOnStartListener = $router.transitionService.onStart(
|
|
592
|
+
{},
|
|
593
|
+
updateAfterTransition,
|
|
594
|
+
);
|
|
599
595
|
const deregisterStateChangeSuccessListener = $scope.$on(
|
|
600
596
|
"$stateChangeSuccess",
|
|
601
597
|
update,
|
|
@@ -621,7 +617,7 @@ export let uiSrefActiveDirective = [
|
|
|
621
617
|
if (isString(stateOrName)) {
|
|
622
618
|
// If state is string, just add it.
|
|
623
619
|
addStateForClass(stateOrName, activeClass);
|
|
624
|
-
} else if (isArray(stateOrName)) {
|
|
620
|
+
} else if (Array.isArray(stateOrName)) {
|
|
625
621
|
// If state is an array, iterate over it and add each array item individually.
|
|
626
622
|
forEach(stateOrName, function (stateOrName) {
|
|
627
623
|
addStateForClass(stateOrName, activeClass);
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { filter, tail, unnestR } from "../../
|
|
2
|
-
import { isDefined, isFunction, isString } from "../../
|
|
3
|
-
import { kebobString } from "../../
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { filter, tail, unnestR } from "../../shared/common";
|
|
2
|
+
import { isDefined, isFunction, isString } from "../../shared/utils";
|
|
3
|
+
import { kebobString } from "../../shared/strings";
|
|
4
|
+
import { noop } from "../../shared/common";
|
|
5
|
+
import { parse } from "../../shared/hof";
|
|
6
|
+
import { ResolveContext } from "../resolve/resolveContext";
|
|
7
|
+
import { trace } from "../common/trace";
|
|
7
8
|
import { getLocals } from "../services";
|
|
8
|
-
import { Ng1ViewConfig } from "../
|
|
9
|
-
import { jqLite } from "
|
|
9
|
+
import { Ng1ViewConfig } from "../state/views";
|
|
10
|
+
import { jqLite } from "../../jqLite";
|
|
10
11
|
/**
|
|
11
12
|
* `ui-view`: A viewport directive which is filled in by a view from the active state.
|
|
12
13
|
*
|
|
@@ -337,7 +338,7 @@ export function $ViewDirectiveFill(
|
|
|
337
338
|
);
|
|
338
339
|
return;
|
|
339
340
|
}
|
|
340
|
-
const cfg = data.$cfg || { viewDecl: {}, getTemplate:
|
|
341
|
+
const cfg = data.$cfg || { viewDecl: {}, getTemplate: noop };
|
|
341
342
|
const resolveCtx = cfg.path && new ResolveContext(cfg.path);
|
|
342
343
|
$element.html(cfg.getTemplate($element, resolveCtx) || initial);
|
|
343
344
|
trace.traceUIViewFill(data.$uiView, $element.html());
|
|
@@ -12,13 +12,23 @@ export class UIRouterGlobals {
|
|
|
12
12
|
* Current parameter values
|
|
13
13
|
*
|
|
14
14
|
* The parameter values from the latest successful transition
|
|
15
|
+
* @type {StateParams}
|
|
15
16
|
*/
|
|
16
17
|
this.params = new StateParams();
|
|
17
|
-
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @type {Number}
|
|
21
|
+
*/
|
|
18
22
|
this.lastStartedTransitionId = -1;
|
|
19
|
-
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @type {Queue}
|
|
26
|
+
*/
|
|
20
27
|
this.transitionHistory = new Queue([], 1);
|
|
21
|
-
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @type {Queue}
|
|
31
|
+
*/
|
|
22
32
|
this.successfulTransitions = new Queue([], 1);
|
|
23
33
|
}
|
|
24
34
|
dispose() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Transition } from "../transition/transition";
|
|
2
2
|
import { UIRouter } from "../router";
|
|
3
3
|
import { Resolvable } from "../resolve/resolvable";
|
|
4
|
-
import { inArray, uniqR, unnestR } from "
|
|
4
|
+
import { inArray, uniqR, unnestR } from "../../shared/common";
|
|
5
5
|
function addCoreResolvables(trans) {
|
|
6
6
|
trans.addResolvable(Resolvable.fromData(UIRouter, trans.router), "");
|
|
7
7
|
trans.addResolvable(Resolvable.fromData(Transition, trans), "");
|
|
@@ -11,15 +11,17 @@ function addCoreResolvables(trans) {
|
|
|
11
11
|
trans.addResolvable(Resolvable.fromData("$state$", state), state);
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export function registerAddCoreResolvables(transitionService) {
|
|
15
15
|
transitionService.onCreate({}, addCoreResolvables);
|
|
16
|
+
}
|
|
17
|
+
|
|
16
18
|
const TRANSITION_TOKENS = ["$transition$", Transition];
|
|
17
19
|
const isTransition = inArray(TRANSITION_TOKENS);
|
|
18
20
|
// References to Transition in the treeChanges pathnodes makes all
|
|
19
21
|
// previous Transitions reachable in memory, causing a memory leak
|
|
20
22
|
// This function removes resolves for '$transition$' and `Transition` from the treeChanges.
|
|
21
23
|
// Do not use this on current transitions, only on old ones.
|
|
22
|
-
export
|
|
24
|
+
export function treeChangesCleanup(trans) {
|
|
23
25
|
const nodes = Object.values(trans.treeChanges())
|
|
24
26
|
.reduce(unnestR, [])
|
|
25
27
|
.reduce(uniqR, []);
|
|
@@ -30,4 +32,4 @@ export const treeChangesCleanup = (trans) => {
|
|
|
30
32
|
nodes.forEach((node) => {
|
|
31
33
|
node.resolvables = node.resolvables.map(replaceTransitionWithNull);
|
|
32
34
|
});
|
|
33
|
-
}
|
|
35
|
+
}
|
|
@@ -57,11 +57,14 @@ const lazyLoadHook = (transition) => {
|
|
|
57
57
|
.map((state) => lazyLoadState(transition, state));
|
|
58
58
|
return services.$q.all(promises).then(retryTransition);
|
|
59
59
|
};
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
|
|
61
|
+
export function registerLazyLoadHook(transitionService) {
|
|
62
|
+
return transitionService.onBefore(
|
|
62
63
|
{ entering: (state) => !!state.lazyLoad },
|
|
63
64
|
lazyLoadHook,
|
|
64
65
|
);
|
|
66
|
+
}
|
|
67
|
+
|
|
65
68
|
/**
|
|
66
69
|
* Invokes a state's lazy load function
|
|
67
70
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { noop } from "../../shared/common";
|
|
1
2
|
import { ResolveContext } from "../resolve/resolveContext";
|
|
2
|
-
import { val } from "
|
|
3
|
+
import { val } from "../../shared/hof";
|
|
3
4
|
export const RESOLVE_HOOK_PRIORITY = 1000;
|
|
4
5
|
/**
|
|
5
6
|
* A [[TransitionHookFn]] which resolves all EAGER Resolvables in the To Path
|
|
@@ -13,7 +14,7 @@ export const RESOLVE_HOOK_PRIORITY = 1000;
|
|
|
13
14
|
const eagerResolvePath = (trans) =>
|
|
14
15
|
new ResolveContext(trans.treeChanges().to)
|
|
15
16
|
.resolvePath("EAGER", trans)
|
|
16
|
-
.then(
|
|
17
|
+
.then(noop);
|
|
17
18
|
export const registerEagerResolvePath = (transitionService) =>
|
|
18
19
|
transitionService.onStart({}, eagerResolvePath, {
|
|
19
20
|
priority: RESOLVE_HOOK_PRIORITY,
|
|
@@ -31,7 +32,7 @@ const lazyResolveState = (trans, state) =>
|
|
|
31
32
|
new ResolveContext(trans.treeChanges().to)
|
|
32
33
|
.subContext(state.$$state())
|
|
33
34
|
.resolvePath("LAZY", trans)
|
|
34
|
-
.then(
|
|
35
|
+
.then(noop);
|
|
35
36
|
export const registerLazyResolveState = (transitionService) =>
|
|
36
37
|
transitionService.onEnter({ entering: val(true) }, lazyResolveState, {
|
|
37
38
|
priority: RESOLVE_HOOK_PRIORITY,
|
|
@@ -49,7 +50,7 @@ export const registerLazyResolveState = (transitionService) =>
|
|
|
49
50
|
const resolveRemaining = (trans) =>
|
|
50
51
|
new ResolveContext(trans.treeChanges().to)
|
|
51
52
|
.resolvePath("LAZY", trans)
|
|
52
|
-
.then(
|
|
53
|
+
.then(noop);
|
|
53
54
|
export const registerResolveRemaining = (transitionService) =>
|
|
54
55
|
transitionService.onFinish({}, resolveRemaining, {
|
|
55
56
|
priority: RESOLVE_HOOK_PRIORITY,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { noop } from "../../shared/common";
|
|
1
2
|
import { services } from "../common/coreservices";
|
|
2
3
|
/**
|
|
3
4
|
* A [[TransitionHookFn]] which waits for the views to load
|
|
@@ -11,9 +12,7 @@ const loadEnteringViews = (transition) => {
|
|
|
11
12
|
const $q = services.$q;
|
|
12
13
|
const enteringViews = transition.views("entering");
|
|
13
14
|
if (!enteringViews.length) return;
|
|
14
|
-
return $q
|
|
15
|
-
.all(enteringViews.map((view) => $q.when(view.load())))
|
|
16
|
-
.then(() => {});
|
|
15
|
+
return $q.all(enteringViews.map((view) => $q.when(view.load()))).then(noop);
|
|
17
16
|
};
|
|
18
17
|
export const registerLoadEnteringViews = (transitionService) =>
|
|
19
18
|
transitionService.onFinish({}, loadEnteringViews);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {
|
|
2
|
+
$routerProvider,
|
|
3
|
+
getProviderFor,
|
|
4
|
+
getStateProvider,
|
|
5
|
+
router,
|
|
6
|
+
runBlock,
|
|
7
|
+
watchDigests,
|
|
8
|
+
} from "./services";
|
|
9
|
+
import { TemplateFactory } from "./templateFactory";
|
|
10
|
+
import { trace } from "./common/trace";
|
|
11
|
+
import { $ViewScrollProvider } from "./viewScroll";
|
|
12
|
+
import { $IsStateFilter, $IncludedByStateFilter } from "./stateFilters";
|
|
13
|
+
import {
|
|
14
|
+
uiSrefActiveDirective,
|
|
15
|
+
uiStateDirective,
|
|
16
|
+
uiSrefDirective,
|
|
17
|
+
} from "./directives/stateDirectives";
|
|
18
|
+
import { uiView, $ViewDirectiveFill } from "./directives/viewDirective";
|
|
19
|
+
|
|
20
|
+
export function initRouter() {
|
|
21
|
+
window.angular
|
|
22
|
+
.module("ui.router", ["ng"])
|
|
23
|
+
.provider("$router", $routerProvider)
|
|
24
|
+
.provider("$urlService", getProviderFor("urlService"))
|
|
25
|
+
.provider("$urlMatcherFactory", [
|
|
26
|
+
"$routerProvider",
|
|
27
|
+
function RouterProvide() {
|
|
28
|
+
return router.urlMatcherFactory;
|
|
29
|
+
},
|
|
30
|
+
])
|
|
31
|
+
.provider("$templateFactory", function () {
|
|
32
|
+
return new TemplateFactory();
|
|
33
|
+
})
|
|
34
|
+
.provider("$stateRegistry", getProviderFor("stateRegistry"))
|
|
35
|
+
.provider("$routerGlobals", getProviderFor("globals"))
|
|
36
|
+
.provider("$transitions", getProviderFor("transitionService"))
|
|
37
|
+
.provider("$state", ["$routerProvider", getStateProvider])
|
|
38
|
+
.provider("$uiViewScroll", $ViewScrollProvider)
|
|
39
|
+
.factory("$stateParams", [
|
|
40
|
+
"$router",
|
|
41
|
+
function StateParamse($router) {
|
|
42
|
+
return $router.globals.params;
|
|
43
|
+
},
|
|
44
|
+
])
|
|
45
|
+
.factory("$view", function () {
|
|
46
|
+
return router.viewService;
|
|
47
|
+
})
|
|
48
|
+
.value("$trace", trace)
|
|
49
|
+
.filter("isState", $IsStateFilter)
|
|
50
|
+
.filter("includedByState", $IncludedByStateFilter)
|
|
51
|
+
.directive("uiSref", uiSrefDirective)
|
|
52
|
+
.directive("uiSrefActive", uiSrefActiveDirective)
|
|
53
|
+
.directive("uiSrefActiveEq", uiSrefActiveDirective)
|
|
54
|
+
.directive("uiState", uiStateDirective)
|
|
55
|
+
.directive("uiView", uiView)
|
|
56
|
+
.directive("uiView", $ViewDirectiveFill)
|
|
57
|
+
|
|
58
|
+
.run(watchDigests)
|
|
59
|
+
.run(runBlock);
|
|
60
|
+
}
|