@angular-wave/angular.ts 0.7.0-beta.1 → 0.7.2
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/.github/workflows/ci.yml +58 -14
- package/.github/workflows/gh-pages.yml +75 -0
- package/@types/animations/animate.d.ts +11 -4
- package/@types/core/compile/attributes.d.ts +5 -2
- package/@types/core/compile/compile.d.ts +6 -6
- package/@types/core/di/injector.d.ts +1 -2
- package/@types/core/di/internal-injector.d.ts +10 -7
- package/@types/core/di/ng-module.d.ts +0 -1
- package/@types/core/error-handler.d.ts +1 -1
- package/@types/core/exception-handler.d.ts +1 -1
- package/@types/core/parse/interface.d.ts +3 -3
- package/@types/core/pubsub/pubsub.d.ts +21 -0
- package/@types/core/sce/sce.d.ts +2 -5
- package/@types/core/scope/scope.d.ts +23 -36
- package/@types/core/task-tracker-factory.d.ts +10 -5
- package/@types/directive/aria/aria.d.ts +4 -1
- package/@types/directive/include/include.d.ts +4 -18
- package/@types/directive/options/options.d.ts +1 -1
- package/@types/injection-tokens.d.ts +20 -0
- package/@types/interface.d.ts +4 -4
- package/@types/loader.d.ts +1 -0
- package/@types/public.d.ts +2 -2
- package/@types/router/directives/view-directive.d.ts +0 -2
- package/@types/router/params/param.d.ts +1 -1
- package/@types/router/state/interface.d.ts +3 -3
- package/@types/router/state/state-builder.d.ts +9 -2
- package/@types/router/transition/transition-service.d.ts +1 -0
- package/@types/services/anchor-scroll.d.ts +0 -1
- package/@types/shared/utils.d.ts +4 -14
- package/README.md +7 -9
- package/dist/angular-ts.esm.js +440 -302
- package/dist/angular-ts.umd.js +440 -302
- package/dist/angular-ts.umd.min.js +1 -1
- package/docs/.cspell.yml +2 -2
- package/docs/.github/dependabot.yml +12 -12
- package/docs/README.md +10 -7
- package/docs/assets/icons/logo.svg +1 -0
- package/docs/assets/scss/_variables_project.scss +1 -0
- package/docs/content/en/_index.md +5 -64
- package/docs/content/en/docs/_index.md +3 -4
- package/docs/docker-compose.yaml +1 -0
- package/docs/go.mod +1 -1
- package/docs/go.sum +6 -6
- package/docs/hugo-disabled.toml +6 -7
- package/docs/hugo.yaml +45 -64
- package/docs/layouts/404.html +2 -8
- package/docs/layouts/_markup/render-heading.html +1 -0
- package/docs/package-lock.json +2293 -0
- package/docs/package.json +18 -7
- package/index.html +1 -1
- package/package.json +1 -1
- package/src/animations/animate-children-directive.js +2 -1
- package/src/animations/animate-css.js +2 -2
- package/src/animations/animate-runner.js +3 -3
- package/src/animations/animate-swap.js +16 -19
- package/src/animations/animate.js +3 -1
- package/src/animations/shared.js +1 -1
- package/src/core/compile/attributes.js +4 -1
- package/src/core/compile/compile.js +29 -24
- package/src/core/compile/compile.spec.js +368 -371
- package/src/core/controller/controller.spec.js +27 -20
- package/src/core/di/injector.js +2 -5
- package/src/core/di/internal-injector.js +2 -0
- package/src/core/di/ng-module.js +19 -7
- package/src/core/di/ng-module.spec.js +16 -16
- package/src/core/error-handler.ts +1 -1
- package/src/core/exception-handler.js +1 -1
- package/src/core/filter/filter.js +0 -1
- package/src/core/parse/ast/ast.spec.js +1 -9
- package/src/core/parse/interface.ts +3 -3
- package/src/core/parse/parse.js +6 -6
- package/src/core/pubsub/pubsub.js +20 -0
- package/src/core/pubsub/pubsub.spec.js +14 -1
- package/src/core/sanitize/sanitize-uri.js +1 -0
- package/src/core/sce/sce.js +7 -15
- package/src/core/scope/scope.js +114 -117
- package/src/core/scope/scope.spec.js +11 -11
- package/src/core/task-tracker-factory.js +7 -0
- package/src/directive/aria/aria.js +11 -10
- package/src/directive/attrs/attrs.js +2 -1
- package/src/directive/bind/bind.js +2 -3
- package/src/directive/channel/channel.js +0 -1
- package/src/directive/class/class.js +0 -1
- package/src/directive/cloak/cloak.js +0 -1
- package/src/directive/include/include.js +22 -11
- package/src/directive/include/include.spec.js +1 -0
- package/src/directive/input/input-example.html +15 -0
- package/src/directive/input/input.js +8 -2
- package/src/directive/input/input.spec.js +12 -14
- package/src/directive/messages/messages.js +2 -2
- package/src/directive/non-bindable/non-bindable.js +0 -1
- package/src/directive/observe/test.html +1 -1
- package/src/directive/options/options-example.html +13 -0
- package/src/directive/options/options.js +33 -21
- package/src/directive/options/options.spec.js +207 -146
- package/src/directive/repeat/repeat.js +8 -7
- package/src/directive/select/select.spec.js +1 -1
- package/src/directive/setter/setter.js +1 -1
- package/src/directive/setter/setter.spec.js +5 -4
- package/src/directive/style/style.spec.js +1 -1
- package/src/directive/switch/switch.js +1 -2
- package/src/directive/transclude/transclude.js +0 -1
- package/src/directive/validators/validators.js +5 -5
- package/src/examples/counter.html +20 -0
- package/src/filters/order-by.js +2 -1
- package/src/filters/order-by.spec.js +4 -4
- package/src/index.spec.js +11 -0
- package/src/injection-tokens.js +71 -0
- package/src/interface.ts +4 -4
- package/src/loader.js +2 -0
- package/src/public.js +10 -3
- package/src/public.spec.js +1 -0
- package/src/router/directives/state-directives.js +1 -1
- package/src/router/directives/state-directives.spec.js +0 -2
- package/src/router/directives/view-directive.js +1 -2
- package/src/router/params/param.js +1 -1
- package/src/router/state/interface.ts +3 -3
- package/src/router/state/state-builder.js +4 -0
- package/src/router/state/state-builder.spec.js +21 -15
- package/src/router/state/state-registry.js +7 -6
- package/src/router/template-factory.spec.js +15 -9
- package/src/router/transition/transition-service.js +1 -0
- package/src/router/view/view.spec.js +1 -1
- package/src/router/view-scroll.spec.js +3 -4
- package/src/services/anchor-scroll.html +1 -1
- package/src/services/anchor-scroll.js +0 -4
- package/src/services/template-request.js +11 -7
- package/src/shared/noderef.js +1 -3
- package/src/shared/utils.js +5 -22
- package/src/src.html +2 -1
- package/typedoc/assets/hierarchy.js +1 -1
- package/typedoc/assets/navigation.js +1 -1
- package/typedoc/assets/search.js +1 -1
- package/typedoc/classes/animations_animate-cache.AnimateCacheProvider.html +4 -40
- package/typedoc/classes/animations_animate-css-driver.AnimateCssDriverProvider.html +4 -58
- package/typedoc/classes/animations_animate-css.AnimateCssProvider.html +4 -40
- package/typedoc/classes/animations_animate-js-driver.AnimateJsDriverProvider.html +4 -58
- package/typedoc/classes/animations_animate-js.AnimateJsProvider.html +4 -58
- package/typedoc/classes/animations_animate-queue.AnimateQueueProvider.html +4 -69
- package/typedoc/classes/animations_animate-runner.AnimateAsyncRunFactoryProvider.html +4 -40
- package/typedoc/classes/animations_animate-runner.AnimateRunner.html +4 -263
- package/typedoc/classes/animations_animate-runner.AnimateRunnerFactoryProvider.html +4 -40
- package/typedoc/classes/animations_animate.AnimateProvider.html +42 -108
- package/typedoc/classes/animations_animation.AnimationProvider.html +4 -51
- package/typedoc/classes/animations_raf-scheduler.RafSchedulerProvider.html +4 -115
- package/typedoc/classes/core_cache_cache-factory.TemplateCacheProvider.html +4 -29
- package/typedoc/classes/core_compile_attributes.Attributes.html +19 -227
- package/typedoc/classes/core_compile_compile.CompileProvider.html +52 -137
- package/typedoc/classes/core_controller_controller.ControllerProvider.html +4 -73
- package/typedoc/classes/core_di_internal-injector.InjectorService.html +7 -141
- package/typedoc/classes/core_di_internal-injector.ProviderInjector.html +7 -119
- package/typedoc/classes/core_di_ng-module.NgModule.html +4 -256
- package/typedoc/classes/core_exception-handler.ExceptionHandlerProvider.html +4 -69
- package/typedoc/classes/core_filter_filter.FilterProvider.html +4 -69
- package/typedoc/classes/core_interpolate_interpolate.InterpolateProvider.html +4 -84
- package/typedoc/classes/core_location_location.Location.html +5 -387
- package/typedoc/classes/core_location_location.LocationHashbangUrl.html +5 -340
- package/typedoc/classes/core_location_location.LocationHtml5Url.html +5 -340
- package/typedoc/classes/core_location_location.LocationProvider.html +4 -113
- package/typedoc/classes/core_parse_ast_ast.AST.html +4 -359
- package/typedoc/classes/core_parse_interpreter.ASTInterpreter.html +4 -315
- package/typedoc/classes/core_parse_lexer_lexer.Lexer.html +4 -238
- package/typedoc/classes/core_parse_parse.ParseProvider.html +4 -51
- package/typedoc/classes/core_parse_parser_parser.Parser.html +4 -73
- package/typedoc/classes/core_pubsub_pubsub.PubSub.html +4 -146
- package/typedoc/classes/core_pubsub_pubsub.PubSubProvider.html +576 -0
- package/typedoc/classes/core_sanitize_sanitize-uri.SanitizeUriProvider.html +4 -62
- package/typedoc/classes/core_sce_sce.SceDelegateProvider.html +4 -73
- package/typedoc/classes/core_sce_sce.SceProvider.html +10 -63
- package/typedoc/classes/core_scope_scope.RootScopeProvider.html +4 -51
- package/typedoc/classes/core_scope_scope.Scope.html +49 -1280
- package/typedoc/classes/core_task-tracker-factory.TaskTracker.html +4 -84
- package/typedoc/classes/core_task-tracker-factory.TaskTrackerFactoryProvider.html +23 -128
- package/typedoc/classes/directive_aria_aria.AriaProvider.html +4 -51
- package/typedoc/classes/directive_form_form.FormController.html +4 -429
- package/typedoc/classes/directive_model_model.NgModelController.html +4 -983
- package/typedoc/classes/loader.Angular.html +46 -179
- package/typedoc/classes/router_common_glob.Glob.html +4 -84
- package/typedoc/classes/router_common_queue.Queue.html +4 -161
- package/typedoc/classes/router_common_trace.Trace.html +4 -249
- package/typedoc/classes/router_globals.RouterGlobals.html +4 -117
- package/typedoc/classes/router_params_param-factory.ParamFactory.html +4 -73
- package/typedoc/classes/router_params_param-type.ParamType.html +4 -150
- package/typedoc/classes/router_params_param-types.ParamTypes.html +4 -95
- package/typedoc/classes/router_params_param.Param.html +4 -260
- package/typedoc/classes/router_params_state-params.StateParams.html +4 -40
- package/typedoc/classes/router_path_path-node.PathNode.html +4 -174
- package/typedoc/classes/router_path_path-utils.PathUtils.html +4 -128
- package/typedoc/classes/router_resolve_resolvable.Resolvable.html +4 -256
- package/typedoc/classes/router_resolve_resolve-context.ResolveContext.html +4 -150
- package/typedoc/classes/router_state-provider.StateProvider.html +4 -84
- package/typedoc/classes/router_state_state-builder.StateBuilder.html +4 -106
- package/typedoc/classes/router_state_state-matcher.StateMatcher.html +4 -73
- package/typedoc/classes/router_state_state-object.StateObject.html +4 -230
- package/typedoc/classes/router_state_state-queue-manager.StateQueueManager.html +4 -128
- package/typedoc/classes/router_state_state-registry.StateRegistryProvider.html +5 -246
- package/typedoc/classes/router_state_state-service.StateProvider.html +4 -322
- package/typedoc/classes/router_state_target-state.TargetState.html +4 -252
- package/typedoc/classes/router_state_views.ViewConfig.html +4 -161
- package/typedoc/classes/router_template-factory.TemplateFactoryProvider.html +4 -179
- package/typedoc/classes/router_transition_hook-builder.HookBuilder.html +4 -73
- package/typedoc/classes/router_transition_hook-registry.RegisteredHook.html +4 -201
- package/typedoc/classes/router_transition_reject-factory.Rejection.html +4 -183
- package/typedoc/classes/router_transition_transition-event-type.TransitionEventType.html +4 -117
- package/typedoc/classes/router_transition_transition-hook.TransitionHook.html +4 -280
- package/typedoc/classes/router_transition_transition-service.TransitionProvider.html +5 -238
- package/typedoc/classes/router_transition_transition.Transition.html +4 -648
- package/typedoc/classes/router_url_url-config.UrlConfigProvider.html +4 -149
- package/typedoc/classes/router_url_url-matcher.UrlMatcher.html +4 -274
- package/typedoc/classes/router_url_url-rule.BaseUrlRule.html +4 -95
- package/typedoc/classes/router_url_url-rule.UrlRuleFactory.html +4 -124
- package/typedoc/classes/router_url_url-rules.UrlRules.html +4 -222
- package/typedoc/classes/router_url_url-service.UrlService.html +4 -373
- package/typedoc/classes/router_view-scroll.ViewScrollProvider.html +4 -69
- package/typedoc/classes/router_view_view.ViewService.html +4 -223
- package/typedoc/classes/services_anchor-scroll.AnchorScrollProvider.html +4 -164
- package/typedoc/classes/services_browser.Browser.html +4 -276
- package/typedoc/classes/services_browser.BrowserProvider.html +4 -29
- package/typedoc/classes/services_http-backend_http-backend.HttpBackendProvider.html +4 -40
- package/typedoc/classes/services_http_http.HttpParamSerializerProvider.html +4 -40
- package/typedoc/classes/services_http_http.HttpProvider.html +4 -84
- package/typedoc/classes/services_log.LogProvider.html +4 -91
- package/typedoc/classes/services_template-request.TemplateRequestProvider.html +4 -51
- package/typedoc/classes/shared_noderef.NodeRef.html +4 -301
- package/typedoc/enums/core_parse_ast-type.ASTType.html +4 -212
- package/typedoc/enums/router_common_trace.Category.html +4 -80
- package/typedoc/enums/router_transition_interface.TransitionHookPhase.html +4 -73
- package/typedoc/enums/router_transition_interface.TransitionHookScope.html +4 -40
- package/typedoc/enums/router_transition_reject-factory.RejectType.html +4 -80
- package/typedoc/functions/animations_animate-cache.animateCache.html +4 -84
- package/typedoc/functions/animations_animate-children-directive.__AnimateChildrenDirective.html +4 -29
- package/typedoc/functions/animations_animate-swap.ngAnimateSwapDirective.html +4 -29
- package/typedoc/functions/animations_shared.applyAnimationClassesFactory.html +4 -18
- package/typedoc/functions/animations_shared.applyAnimationFromStyles.html +4 -18
- package/typedoc/functions/animations_shared.applyAnimationStyles.html +4 -18
- package/typedoc/functions/animations_shared.applyAnimationToStyles.html +4 -18
- package/typedoc/functions/animations_shared.applyGeneratedPreparationClasses.html +4 -18
- package/typedoc/functions/animations_shared.applyInlineStyle.html +4 -18
- package/typedoc/functions/animations_shared.assertArg.html +4 -18
- package/typedoc/functions/animations_shared.blockKeyframeAnimations.html +4 -18
- package/typedoc/functions/animations_shared.clearGeneratedClasses.html +4 -18
- package/typedoc/functions/animations_shared.concatWithSpace.html +4 -18
- package/typedoc/functions/animations_shared.extractElementNode.html +4 -18
- package/typedoc/functions/animations_shared.mergeAnimationDetails.html +4 -18
- package/typedoc/functions/animations_shared.mergeClasses.html +4 -18
- package/typedoc/functions/animations_shared.packageStyles.html +4 -18
- package/typedoc/functions/animations_shared.pendClasses.html +4 -18
- package/typedoc/functions/animations_shared.prepareAnimationOptions.html +4 -18
- package/typedoc/functions/animations_shared.removeFromArray.html +4 -18
- package/typedoc/functions/animations_shared.resolveElementClasses.html +4 -18
- package/typedoc/functions/animations_shared.stripCommentsFromElement.html +4 -18
- package/typedoc/functions/core_controller_controller.identifierForController.html +4 -18
- package/typedoc/functions/core_di_injector.annotate.html +4 -18
- package/typedoc/functions/core_di_injector.createInjector.html +4 -18
- package/typedoc/functions/core_location_location.serverBase.html +4 -18
- package/typedoc/functions/core_location_location.stripBaseUrl.html +4 -18
- package/typedoc/functions/core_location_location.stripFile.html +4 -18
- package/typedoc/functions/core_location_location.stripHash.html +4 -18
- package/typedoc/functions/core_parse_interpreter.isAssignable.html +4 -18
- package/typedoc/functions/core_parse_parse.constantWatchDelegate.html +4 -18
- package/typedoc/functions/core_sce_sce.adjustMatcher.html +4 -18
- package/typedoc/functions/core_sce_sce.escapeForRegexp.html +4 -18
- package/typedoc/functions/core_scope_scope.createScope.html +4 -18
- package/typedoc/functions/core_scope_scope.nextId.html +4 -18
- package/typedoc/functions/core_url-utils_url-utils.getBaseUrl.html +4 -18
- package/typedoc/functions/core_url-utils_url-utils.urlIsAllowedOriginFactory.html +4 -18
- package/typedoc/functions/core_url-utils_url-utils.urlIsSameOrigin.html +4 -18
- package/typedoc/functions/core_url-utils_url-utils.urlIsSameOriginAsBaseUrl.html +4 -18
- package/typedoc/functions/core_url-utils_url-utils.urlResolve.html +4 -18
- package/typedoc/functions/core_url-utils_url-utils.urlsAreSameOrigin.html +4 -18
- package/typedoc/functions/directive_aria_aria.ngCheckedAriaDirective.html +4 -29
- package/typedoc/functions/directive_aria_aria.ngClickAriaDirective.html +6 -31
- package/typedoc/functions/directive_aria_aria.ngDblclickAriaDirective.html +4 -29
- package/typedoc/functions/directive_aria_aria.ngDisabledAriaDirective.html +4 -29
- package/typedoc/functions/directive_aria_aria.ngHideAriaDirective.html +4 -29
- package/typedoc/functions/directive_aria_aria.ngMessagesAriaDirective.html +4 -18
- package/typedoc/functions/directive_aria_aria.ngModelAriaDirective.html +4 -29
- package/typedoc/functions/directive_aria_aria.ngReadonlyAriaDirective.html +4 -29
- package/typedoc/functions/directive_aria_aria.ngRequiredAriaDirective.html +4 -29
- package/typedoc/functions/directive_aria_aria.ngShowAriaDirective.html +4 -29
- package/typedoc/functions/directive_aria_aria.ngValueAriaDirective.html +4 -29
- package/typedoc/functions/directive_bind_bind.ngBindDirective.html +4 -18
- package/typedoc/functions/directive_bind_bind.ngBindHtmlDirective.html +4 -29
- package/typedoc/functions/directive_bind_bind.ngBindTemplateDirective.html +4 -18
- package/typedoc/functions/directive_channel_channel.ngChannelDirective.html +4 -18
- package/typedoc/functions/directive_cloak_cloak.ngCloakDirective.html +4 -18
- package/typedoc/functions/directive_controller_controller.ngControllerDirective.html +4 -18
- package/typedoc/functions/directive_events_events.createEventDirective.html +4 -18
- package/typedoc/functions/directive_form_form.setupValidity.html +4 -18
- package/typedoc/functions/directive_if_if.ngIfDirective.html +4 -29
- package/typedoc/functions/directive_include_include.ngIncludeDirective.html +33 -178
- package/typedoc/functions/directive_include_include.ngIncludeFillContentDirective.html +4 -29
- package/typedoc/functions/directive_init_init.ngInitDirective.html +4 -18
- package/typedoc/functions/directive_input_input.badInputChecker.html +4 -18
- package/typedoc/functions/directive_input_input.countDecimals.html +4 -18
- package/typedoc/functions/directive_input_input.createDateInputType.html +4 -18
- package/typedoc/functions/directive_input_input.createDateParser.html +4 -18
- package/typedoc/functions/directive_input_input.hiddenInputBrowserCacheDirective.html +4 -18
- package/typedoc/functions/directive_input_input.inputDirective.html +4 -29
- package/typedoc/functions/directive_input_input.isNumberInteger.html +4 -18
- package/typedoc/functions/directive_input_input.isValidForStep.html +4 -18
- package/typedoc/functions/directive_input_input.ngValueDirective.html +4 -18
- package/typedoc/functions/directive_input_input.numberFormatterParser.html +4 -18
- package/typedoc/functions/directive_input_input.numberInputType.html +4 -18
- package/typedoc/functions/directive_input_input.rangeInputType.html +4 -18
- package/typedoc/functions/directive_input_input.weekParser.html +4 -18
- package/typedoc/functions/directive_messages_messages.ngMessagesDirective.html +4 -29
- package/typedoc/functions/directive_messages_messages.ngMessagesIncludeDirective.html +4 -29
- package/typedoc/functions/directive_model-options_model-options.ngModelOptionsDirective.html +4 -18
- package/typedoc/functions/directive_model_model.ngModelDirective.html +4 -18
- package/typedoc/functions/directive_non-bindable_non-bindable.ngNonBindableDirective.html +4 -18
- package/typedoc/functions/directive_observe_observe.ngObserveDirective.html +4 -18
- package/typedoc/functions/directive_ref_ref.ngRefDirective.html +4 -29
- package/typedoc/functions/directive_repeat_repeat.ngRepeatDirective.html +4 -29
- package/typedoc/functions/directive_script_script.scriptDirective.html +4 -29
- package/typedoc/functions/directive_select_select.optionDirective.html +4 -29
- package/typedoc/functions/directive_select_select.selectDirective.html +4 -18
- package/typedoc/functions/directive_setter_setter.ngSetterDirective.html +4 -29
- package/typedoc/functions/directive_show-hide_show-hide.ngHideDirective.html +4 -29
- package/typedoc/functions/directive_show-hide_show-hide.ngShowDirective.html +4 -29
- package/typedoc/functions/directive_style_style.ngStyleDirective.html +4 -18
- package/typedoc/functions/directive_switch_switch.ngSwitchDefaultDirective.html +4 -18
- package/typedoc/functions/directive_switch_switch.ngSwitchDirective.html +4 -29
- package/typedoc/functions/directive_switch_switch.ngSwitchWhenDirective.html +4 -18
- package/typedoc/functions/filters_filter.filterFilter.html +4 -18
- package/typedoc/functions/filters_filters.formatNumber.html +4 -18
- package/typedoc/functions/filters_filters.jsonFilter.html +4 -18
- package/typedoc/functions/filters_limit-to.limitToFilter.html +4 -18
- package/typedoc/functions/filters_order-by.orderByFilter.html +4 -29
- package/typedoc/functions/public.publishExternalAPI.html +6 -24
- package/typedoc/functions/router_common_glob.hasGlobs.html +4 -18
- package/typedoc/functions/router_directives_state-directives._StateRefActiveDirective.html +4 -29
- package/typedoc/functions/router_directives_state-directives._StateRefDirective.html +4 -29
- package/typedoc/functions/router_directives_state-directives._StateRefDynamicDirective.html +4 -29
- package/typedoc/functions/router_directives_view-directive._ViewDirectiveFill.html +4 -39
- package/typedoc/functions/router_hooks_core-resolvables.registerAddCoreResolvables.html +4 -18
- package/typedoc/functions/router_hooks_core-resolvables.treeChangesCleanup.html +4 -18
- package/typedoc/functions/router_hooks_ignored-transition.registerIgnoredTransitionHook.html +4 -18
- package/typedoc/functions/router_hooks_invalid-transition.registerInvalidTransitionHook.html +4 -18
- package/typedoc/functions/router_hooks_lazy-load.lazyLoadState.html +4 -18
- package/typedoc/functions/router_hooks_lazy-load.registerLazyLoadHook.html +4 -18
- package/typedoc/functions/router_hooks_on-enter-exit-retain.registerOnEnterHook.html +4 -18
- package/typedoc/functions/router_hooks_on-enter-exit-retain.registerOnExitHook.html +4 -18
- package/typedoc/functions/router_hooks_on-enter-exit-retain.registerOnRetainHook.html +4 -18
- package/typedoc/functions/router_hooks_redirect-to.registerRedirectToHook.html +4 -18
- package/typedoc/functions/router_hooks_resolve.registerEagerResolvePath.html +4 -18
- package/typedoc/functions/router_hooks_resolve.registerLazyResolveState.html +4 -18
- package/typedoc/functions/router_hooks_resolve.registerResolveRemaining.html +4 -18
- package/typedoc/functions/router_hooks_update-globals.registerUpdateGlobalState.html +4 -18
- package/typedoc/functions/router_hooks_url.registerUpdateUrl.html +4 -18
- package/typedoc/functions/router_hooks_views.registerActivateViews.html +4 -18
- package/typedoc/functions/router_hooks_views.registerLoadEnteringViews.html +4 -18
- package/typedoc/functions/router_path_path-utils.makeTargetState.html +4 -18
- package/typedoc/functions/router_state-filters._IncludedByStateFilter.html +4 -29
- package/typedoc/functions/router_state-filters._IsStateFilter.html +4 -29
- package/typedoc/functions/router_state_state-builder.resolvablesBuilder.html +4 -18
- package/typedoc/functions/router_state_state-registry.getLocals.html +4 -18
- package/typedoc/functions/router_state_views.getViewConfigFactory.html +4 -18
- package/typedoc/functions/router_state_views.ng1ViewsBuilder.html +4 -18
- package/typedoc/functions/router_transition_hook-registry.makeEvent.html +4 -18
- package/typedoc/functions/router_transition_hook-registry.matchState.html +4 -18
- package/typedoc/functions/services_browser.trimEmptyHash.html +4 -18
- package/typedoc/functions/services_cookie-reader.getCookies.html +4 -18
- package/typedoc/functions/services_http-backend_http-backend.createHttpBackend.html +4 -18
- package/typedoc/functions/services_http_http.defaultHttpResponseTransform.html +4 -18
- package/typedoc/functions/shared_common._removeFrom.html +4 -18
- package/typedoc/functions/shared_common.allTrueR.html +4 -18
- package/typedoc/functions/shared_common.ancestors.html +4 -18
- package/typedoc/functions/shared_common.anyTrueR.html +4 -18
- package/typedoc/functions/shared_common.applyPairs.html +4 -18
- package/typedoc/functions/shared_common.arrayTuples.html +4 -18
- package/typedoc/functions/shared_common.assertFn.html +4 -18
- package/typedoc/functions/shared_common.copy.html +4 -18
- package/typedoc/functions/shared_common.createProxyFunctions.html +4 -18
- package/typedoc/functions/shared_common.defaults.html +4 -18
- package/typedoc/functions/shared_common.deregAll.html +4 -18
- package/typedoc/functions/shared_common.equals.html +4 -18
- package/typedoc/functions/shared_common.filter.html +4 -18
- package/typedoc/functions/shared_common.find.html +4 -18
- package/typedoc/functions/shared_common.flatten.html +4 -18
- package/typedoc/functions/shared_common.flattenR.html +4 -18
- package/typedoc/functions/shared_common.inherit.html +4 -18
- package/typedoc/functions/shared_common.map.html +4 -18
- package/typedoc/functions/shared_common.omit.html +4 -18
- package/typedoc/functions/shared_common.pairs.html +4 -18
- package/typedoc/functions/shared_common.pick.html +4 -18
- package/typedoc/functions/shared_common.pushR.html +4 -18
- package/typedoc/functions/shared_common.silenceUncaughtInPromise.html +4 -18
- package/typedoc/functions/shared_common.silentRejection.html +4 -18
- package/typedoc/functions/shared_common.tail.html +4 -18
- package/typedoc/functions/shared_common.uniqR.html +4 -18
- package/typedoc/functions/shared_common.unnest.html +4 -18
- package/typedoc/functions/shared_common.unnestR.html +4 -18
- package/typedoc/functions/shared_dom.appendNodesToElement.html +4 -18
- package/typedoc/functions/shared_dom.buildFragment.html +4 -18
- package/typedoc/functions/shared_dom.cleanElementData.html +4 -18
- package/typedoc/functions/shared_dom.createElementFromHTML.html +4 -18
- package/typedoc/functions/shared_dom.createNodelistFromHTML.html +4 -18
- package/typedoc/functions/shared_dom.dealoc.html +4 -18
- package/typedoc/functions/shared_dom.deleteCacheData.html +4 -18
- package/typedoc/functions/shared_dom.domInsert.html +4 -18
- package/typedoc/functions/shared_dom.emptyElement.html +4 -18
- package/typedoc/functions/shared_dom.getBlockNodes.html +4 -18
- package/typedoc/functions/shared_dom.getBooleanAttrName.html +4 -18
- package/typedoc/functions/shared_dom.getCacheData.html +4 -18
- package/typedoc/functions/shared_dom.getController.html +4 -18
- package/typedoc/functions/shared_dom.getExpando.html +4 -18
- package/typedoc/functions/shared_dom.getInheritedData.html +4 -18
- package/typedoc/functions/shared_dom.getInjector.html +4 -18
- package/typedoc/functions/shared_dom.getIsolateScope.html +4 -18
- package/typedoc/functions/shared_dom.getOrSetCacheData.html +4 -18
- package/typedoc/functions/shared_dom.getScope.html +4 -18
- package/typedoc/functions/shared_dom.isRoot.html +4 -18
- package/typedoc/functions/shared_dom.isTextNode.html +4 -18
- package/typedoc/functions/shared_dom.kebabToCamel.html +4 -18
- package/typedoc/functions/shared_dom.parseHtml.html +4 -18
- package/typedoc/functions/shared_dom.removeElement.html +4 -18
- package/typedoc/functions/shared_dom.removeElementData.html +4 -18
- package/typedoc/functions/shared_dom.setCacheData.html +4 -18
- package/typedoc/functions/shared_dom.setInheritedData.html +4 -18
- package/typedoc/functions/shared_dom.setIsolateScope.html +4 -18
- package/typedoc/functions/shared_dom.setScope.html +4 -18
- package/typedoc/functions/shared_dom.snakeToCamel.html +4 -18
- package/typedoc/functions/shared_dom.startingTag.html +4 -18
- package/typedoc/functions/shared_hof.all.html +4 -18
- package/typedoc/functions/shared_hof.compose.html +4 -18
- package/typedoc/functions/shared_hof.curry.html +4 -18
- package/typedoc/functions/shared_hof.is.html +4 -18
- package/typedoc/functions/shared_hof.or.html +4 -18
- package/typedoc/functions/shared_hof.parse.html +4 -18
- package/typedoc/functions/shared_hof.pattern.html +4 -18
- package/typedoc/functions/shared_hof.pipe.html +4 -18
- package/typedoc/functions/shared_hof.val.html +4 -18
- package/typedoc/functions/shared_predicates.isInjectable.html +4 -18
- package/typedoc/functions/shared_predicates.isPromise.html +4 -18
- package/typedoc/functions/shared_strings.beforeAfterSubstr.html +4 -18
- package/typedoc/functions/shared_strings.fnToString.html +4 -18
- package/typedoc/functions/shared_strings.functionToString.html +4 -18
- package/typedoc/functions/shared_strings.joinNeighborsR.html +4 -18
- package/typedoc/functions/shared_strings.kebobString.html +4 -18
- package/typedoc/functions/shared_strings.maxLength.html +4 -18
- package/typedoc/functions/shared_strings.padString.html +4 -18
- package/typedoc/functions/shared_strings.splitOnDelim.html +4 -18
- package/typedoc/functions/shared_strings.stringify.html +4 -18
- package/typedoc/functions/shared_strings.stripLastPathElement.html +4 -18
- package/typedoc/functions/shared_strings.trimHashVal.html +4 -18
- package/typedoc/functions/shared_test-utils.bootstrap.html +4 -18
- package/typedoc/functions/shared_test-utils.browserTrigger.html +4 -18
- package/typedoc/functions/shared_test-utils.wait.html +4 -18
- package/typedoc/functions/shared_utils.addDateMinutes.html +4 -18
- package/typedoc/functions/shared_utils.arrayRemove.html +4 -18
- package/typedoc/functions/shared_utils.assert.html +4 -18
- package/typedoc/functions/shared_utils.assertArg.html +4 -18
- package/typedoc/functions/shared_utils.assertArgFn.html +4 -18
- package/typedoc/functions/shared_utils.assertNotHasOwnProperty.html +4 -18
- package/typedoc/functions/shared_utils.baseExtend.html +4 -18
- package/typedoc/functions/shared_utils.bind.html +4 -18
- package/typedoc/functions/shared_utils.concat.html +4 -18
- package/typedoc/functions/shared_utils.convertTimezoneToLocal.html +4 -18
- package/typedoc/functions/shared_utils.csp.html +4 -18
- package/typedoc/functions/shared_utils.directiveNormalize.html +4 -18
- package/typedoc/functions/shared_utils.encodeUriQuery.html +4 -18
- package/typedoc/functions/shared_utils.encodeUriSegment.html +4 -18
- package/typedoc/functions/shared_utils.equals.html +4 -18
- package/typedoc/functions/shared_utils.errorHandlingConfig.html +4 -18
- package/typedoc/functions/shared_utils.extend.html +4 -18
- package/typedoc/functions/shared_utils.fromJson.html +4 -18
- package/typedoc/functions/shared_utils.getNgAttribute.html +4 -18
- package/typedoc/functions/shared_utils.getNodeName.html +4 -18
- package/typedoc/functions/shared_utils.hasAnimate.html +4 -18
- package/typedoc/functions/shared_utils.hasCustomToString.html +4 -18
- package/typedoc/functions/shared_utils.hasOwn.html +4 -18
- package/typedoc/functions/shared_utils.hashKey.html +4 -18
- package/typedoc/functions/shared_utils.includes.html +4 -18
- package/typedoc/functions/shared_utils.inherit.html +4 -18
- package/typedoc/functions/shared_utils.isArrayBuffer.html +4 -18
- package/typedoc/functions/shared_utils.isArrayLike.html +7 -18
- package/typedoc/functions/shared_utils.isBlankObject.html +8 -18
- package/typedoc/functions/shared_utils.isBlob.html +4 -18
- package/typedoc/functions/shared_utils.isBoolean.html +4 -18
- package/typedoc/functions/shared_utils.isDate.html +4 -18
- package/typedoc/functions/shared_utils.isDefined.html +4 -18
- package/typedoc/functions/shared_utils.isElement.html +4 -18
- package/typedoc/functions/shared_utils.isError.html +4 -18
- package/typedoc/functions/shared_utils.isFile.html +4 -18
- package/typedoc/functions/shared_utils.isFormData.html +4 -18
- package/typedoc/functions/shared_utils.isFunction.html +4 -18
- package/typedoc/functions/shared_utils.isNull.html +4 -18
- package/typedoc/functions/shared_utils.isNullOrUndefined.html +4 -18
- package/typedoc/functions/shared_utils.isNumber.html +4 -18
- package/typedoc/functions/shared_utils.isNumberNaN.html +4 -18
- package/typedoc/functions/shared_utils.isObject.html +4 -18
- package/typedoc/functions/shared_utils.isObjectEmpty.html +4 -18
- package/typedoc/functions/shared_utils.isPromiseLike.html +4 -18
- package/typedoc/functions/shared_utils.isProxy.html +4 -18
- package/typedoc/functions/shared_utils.isRegExp.html +4 -18
- package/typedoc/functions/shared_utils.isScope.html +4 -18
- package/typedoc/functions/shared_utils.isString.html +4 -18
- package/typedoc/functions/shared_utils.isTypedArray.html +4 -18
- package/typedoc/functions/shared_utils.isUndefined.html +4 -18
- package/typedoc/functions/shared_utils.isValidObjectMaxDepth.html +4 -18
- package/typedoc/functions/shared_utils.isWindow.html +4 -18
- package/typedoc/functions/shared_utils.lowercase.html +4 -18
- package/typedoc/functions/shared_utils.mergeClasses.html +4 -18
- package/typedoc/functions/shared_utils.minErr.html +4 -18
- package/typedoc/functions/shared_utils.nextUid.html +4 -18
- package/typedoc/functions/shared_utils.parseKeyValue.html +4 -18
- package/typedoc/functions/shared_utils.setHashKey.html +4 -18
- package/typedoc/functions/shared_utils.shallowCopy.html +4 -18
- package/typedoc/functions/shared_utils.simpleCompare.html +4 -18
- package/typedoc/functions/shared_utils.sliceArgs.html +4 -18
- package/typedoc/functions/shared_utils.snakeCase.html +4 -18
- package/typedoc/functions/shared_utils.stringify.html +4 -18
- package/typedoc/functions/shared_utils.timezoneToOffset.html +4 -18
- package/typedoc/functions/shared_utils.toDebugString.html +4 -18
- package/typedoc/functions/shared_utils.toInt.html +4 -18
- package/typedoc/functions/shared_utils.toJson.html +4 -18
- package/typedoc/functions/shared_utils.toKeyValue.html +4 -18
- package/typedoc/functions/shared_utils.trim.html +4 -18
- package/typedoc/functions/shared_utils.tryDecodeURIComponent.html +9 -19
- package/typedoc/functions/shared_utils.uppercase.html +4 -18
- package/typedoc/hierarchy.html +8 -11
- package/typedoc/index.html +5 -8
- package/typedoc/interfaces/animations_animate.AnimationOptions.html +4 -62
- package/typedoc/interfaces/animations_raf-scheduler.ServiceProvider.html +5 -30
- package/typedoc/interfaces/core_cache_cache.ExpandoStore.html +4 -51
- package/typedoc/interfaces/core_compile_compile.LinkFnMapping.html +4 -51
- package/typedoc/interfaces/core_compile_compile.NodeLinkFnCtx.html +4 -84
- package/typedoc/interfaces/core_compile_compile.SimpleChange.html +4 -40
- package/typedoc/interfaces/core_location_location.DefaultPorts.html +4 -51
- package/typedoc/interfaces/core_location_location.Html5Mode.html +4 -51
- package/typedoc/interfaces/core_parse_ast_ast.Token.html +4 -84
- package/typedoc/interfaces/core_parse_interface.CompiledExpressionHandlerMap.html +4 -73
- package/typedoc/interfaces/core_parse_interface.CompiledExpressionProps.html +5 -107
- package/typedoc/interfaces/core_parse_lexer_lexer.LexerOptions.html +4 -40
- package/typedoc/interfaces/core_parse_parser_parser.ParsedAST.html +4 -29
- package/typedoc/interfaces/core_sanitize_interface.SanitizerFn.html +4 -18
- package/typedoc/interfaces/core_scope_scope.AsyncQueueTask.html +4 -51
- package/typedoc/interfaces/core_scope_scope.Listener.html +4 -106
- package/typedoc/interfaces/directive_model-options_model-options.ModelOptionsConfig.html +4 -73
- package/typedoc/interfaces/interface.ChangesObject.html +4 -40
- package/typedoc/interfaces/interface.ComponentOptions.html +4 -95
- package/typedoc/interfaces/interface.Controller.html +5 -74
- package/typedoc/interfaces/interface.Directive.html +6 -207
- package/typedoc/interfaces/interface.DirectivePrePost.html +4 -40
- package/typedoc/interfaces/interface.NgModelController.html +4 -172
- package/typedoc/interfaces/interface.NgModelOptions.html +4 -95
- package/typedoc/interfaces/interface.Provider.html +4 -84
- package/typedoc/interfaces/interface.TranscludeFunctionObject.html +4 -51
- package/typedoc/interfaces/loader.AngularBootstrapConfig.html +4 -29
- package/typedoc/interfaces/router_params_interface.ParamDeclaration.html +4 -117
- package/typedoc/interfaces/router_params_interface.ParamTypeDefinition.html +4 -106
- package/typedoc/interfaces/router_params_interface.RawParams.html +4 -18
- package/typedoc/interfaces/router_params_interface.Replace.html +4 -40
- package/typedoc/interfaces/router_resolve_interface.CustomAsyncPolicy.html +4 -18
- package/typedoc/interfaces/router_resolve_interface.ProviderLike.html +4 -84
- package/typedoc/interfaces/router_resolve_interface.ResolvableLiteral.html +4 -73
- package/typedoc/interfaces/router_resolve_interface.ResolvePolicy.html +4 -40
- package/typedoc/interfaces/router_state_interface.HrefOptions.html +4 -62
- package/typedoc/interfaces/router_state_interface.LazyLoadResult.html +4 -29
- package/typedoc/interfaces/router_state_interface.StateDeclaration.html +11 -212
- package/typedoc/interfaces/router_state_interface.TargetStateDef.html +4 -51
- package/typedoc/interfaces/router_state_interface.TransitionPromise.html +5 -54
- package/typedoc/interfaces/router_state_interface.ViewDeclaration.html +4 -183
- package/typedoc/interfaces/router_template-factory.BindingTuple.html +4 -40
- package/typedoc/interfaces/router_transition_interface.HookMatchCriteria.html +4 -73
- package/typedoc/interfaces/router_transition_interface.HookRegOptions.html +4 -51
- package/typedoc/interfaces/router_transition_interface.IHookRegistry.html +4 -128
- package/typedoc/interfaces/router_transition_interface.IMatchingNodes.html +4 -73
- package/typedoc/interfaces/router_transition_interface.PathType.html +4 -40
- package/typedoc/interfaces/router_transition_interface.PathTypes.html +4 -73
- package/typedoc/interfaces/router_transition_interface.RegisteredHooks.html +4 -18
- package/typedoc/interfaces/router_transition_interface.TransitionCreateHookFn.html +4 -18
- package/typedoc/interfaces/router_transition_interface.TransitionHookFn.html +4 -18
- package/typedoc/interfaces/router_transition_interface.TransitionHookOptions.html +4 -95
- package/typedoc/interfaces/router_transition_interface.TransitionOptions.html +4 -139
- package/typedoc/interfaces/router_transition_interface.TransitionStateHookFn.html +4 -18
- package/typedoc/interfaces/router_transition_interface.TreeChanges.html +4 -84
- package/typedoc/interfaces/router_view_interface.ActiveUIView.html +4 -84
- package/typedoc/interfaces/router_view_interface.ViewConfig.html +4 -73
- package/typedoc/interfaces/router_view_interface.ViewContext.html +4 -40
- package/typedoc/interfaces/services_anchor-scroll.AnchorScrollObject.html +4 -29
- package/typedoc/interfaces/services_log.LogService.html +4 -80
- package/typedoc/interfaces/shared_interface.TypedMap.html +4 -18
- package/typedoc/interfaces/shared_utils.ErrorHandlingConfig.html +4 -40
- package/typedoc/modules/animations_animate-cache.html +4 -7
- package/typedoc/modules/animations_animate-children-directive.html +4 -9
- package/typedoc/modules/animations_animate-css-driver.html +4 -7
- package/typedoc/modules/animations_animate-css.html +4 -7
- package/typedoc/modules/animations_animate-js-driver.html +4 -7
- package/typedoc/modules/animations_animate-js.html +4 -7
- package/typedoc/modules/animations_animate-queue.html +4 -7
- package/typedoc/modules/animations_animate-runner.html +4 -7
- package/typedoc/modules/animations_animate-swap.html +4 -7
- package/typedoc/modules/animations_animate.html +4 -7
- package/typedoc/modules/animations_animation.html +4 -7
- package/typedoc/modules/animations_interface.html +4 -7
- package/typedoc/modules/animations_raf-scheduler.html +4 -7
- package/typedoc/modules/animations_shared.html +4 -7
- package/typedoc/modules/core_cache_cache-factory.html +4 -7
- package/typedoc/modules/core_cache_cache.html +4 -7
- package/typedoc/modules/core_compile_attributes.html +4 -7
- package/typedoc/modules/core_compile_compile.html +4 -7
- package/typedoc/modules/core_controller_controller.html +4 -7
- package/typedoc/modules/core_di_injector.html +4 -65
- package/typedoc/modules/core_di_internal-injector.html +4 -7
- package/typedoc/modules/core_di_ng-module.html +4 -34
- package/typedoc/modules/core_error-handler.html +4 -7
- package/typedoc/modules/core_exception-handler.html +4 -7
- package/typedoc/modules/core_filter_filter.html +4 -7
- package/typedoc/modules/core_interpolate_interpolate.html +4 -7
- package/typedoc/modules/core_location_location.html +4 -7
- package/typedoc/modules/core_parse_ast-type.html +4 -7
- package/typedoc/modules/core_parse_ast_ast-node.html +4 -7
- package/typedoc/modules/core_parse_ast_ast.html +4 -7
- package/typedoc/modules/core_parse_interface.html +4 -7
- package/typedoc/modules/core_parse_interpreter.html +4 -7
- package/typedoc/modules/core_parse_lexer_lexer.html +4 -7
- package/typedoc/modules/core_parse_lexer_token.html +4 -7
- package/typedoc/modules/core_parse_parse.html +4 -7
- package/typedoc/modules/core_parse_parser_parser.html +4 -7
- package/typedoc/modules/core_pubsub_pubsub.html +95 -7
- package/typedoc/modules/core_sanitize_interface.html +4 -7
- package/typedoc/modules/core_sanitize_sanitize-uri.html +4 -7
- package/typedoc/modules/core_sce_sce.html +4 -7
- package/typedoc/modules/core_scope_scope.html +4 -7
- package/typedoc/modules/core_task-tracker-factory.html +134 -7
- package/typedoc/modules/core_url-utils_url-utils.html +4 -7
- package/typedoc/modules/directive_aria_aria.html +4 -7
- package/typedoc/modules/directive_attrs_attrs.html +4 -7
- package/typedoc/modules/directive_bind_bind.html +4 -7
- package/typedoc/modules/directive_channel_channel.html +4 -7
- package/typedoc/modules/directive_class_class.html +4 -7
- package/typedoc/modules/directive_cloak_cloak.html +4 -7
- package/typedoc/modules/directive_controller_controller.html +4 -7
- package/typedoc/modules/directive_events_events.html +4 -7
- package/typedoc/modules/directive_form_form.html +4 -7
- package/typedoc/modules/directive_if_if.html +4 -7
- package/typedoc/modules/directive_include_include.html +4 -7
- package/typedoc/modules/directive_init_init.html +4 -7
- package/typedoc/modules/directive_input_input.html +4 -7
- package/typedoc/modules/directive_messages_messages.html +4 -7
- package/typedoc/modules/directive_model-options_model-options.html +4 -9
- package/typedoc/modules/directive_model_model.html +4 -7
- package/typedoc/modules/directive_non-bindable_non-bindable.html +4 -9
- package/typedoc/modules/directive_observe_observe.html +4 -7
- package/typedoc/modules/directive_options_options.html +4 -7
- package/typedoc/modules/directive_ref_ref.html +4 -7
- package/typedoc/modules/directive_repeat_repeat.html +4 -7
- package/typedoc/modules/directive_script_script.html +4 -7
- package/typedoc/modules/directive_select_select.html +4 -7
- package/typedoc/modules/directive_setter_setter.html +4 -7
- package/typedoc/modules/directive_show-hide_show-hide.html +4 -7
- package/typedoc/modules/directive_style_style.html +4 -7
- package/typedoc/modules/directive_switch_switch.html +4 -7
- package/typedoc/modules/directive_transclude_transclude.html +4 -7
- package/typedoc/modules/directive_validators_validators.html +4 -7
- package/typedoc/modules/filters_filter.html +4 -7
- package/typedoc/modules/filters_filters.html +4 -7
- package/typedoc/modules/filters_limit-to.html +4 -7
- package/typedoc/modules/filters_order-by.html +4 -7
- package/typedoc/modules/index.html +4 -84
- package/typedoc/{variables/index.angular.html → modules/injection-tokens.html} +84 -30
- package/typedoc/modules/interface.html +35 -36
- package/typedoc/modules/loader.html +4 -7
- package/typedoc/modules/public.html +4 -7
- package/typedoc/modules/router_common_glob.html +4 -7
- package/typedoc/modules/router_common_queue.html +4 -7
- package/typedoc/modules/router_common_trace.html +4 -7
- package/typedoc/modules/router_directives_state-directives.html +4 -7
- package/typedoc/modules/router_directives_view-directive.html +4 -7
- package/typedoc/modules/router_globals.html +4 -7
- package/typedoc/modules/router_hooks_core-resolvables.html +4 -7
- package/typedoc/modules/router_hooks_ignored-transition.html +4 -7
- package/typedoc/modules/router_hooks_invalid-transition.html +4 -7
- package/typedoc/modules/router_hooks_lazy-load.html +4 -7
- package/typedoc/modules/router_hooks_on-enter-exit-retain.html +4 -7
- package/typedoc/modules/router_hooks_redirect-to.html +4 -7
- package/typedoc/modules/router_hooks_resolve.html +4 -7
- package/typedoc/modules/router_hooks_update-globals.html +4 -7
- package/typedoc/modules/router_hooks_url.html +4 -7
- package/typedoc/modules/router_hooks_views.html +4 -7
- package/typedoc/modules/router_params_interface.html +4 -7
- package/typedoc/modules/router_params_param-factory.html +4 -7
- package/typedoc/modules/router_params_param-type.html +4 -7
- package/typedoc/modules/router_params_param-types.html +4 -7
- package/typedoc/modules/router_params_param.html +4 -7
- package/typedoc/modules/router_params_state-params.html +4 -7
- package/typedoc/modules/router_path_path-node.html +4 -7
- package/typedoc/modules/router_path_path-utils.html +4 -7
- package/typedoc/modules/router_resolve_interface.html +4 -7
- package/typedoc/modules/router_resolve_resolvable.html +4 -7
- package/typedoc/modules/router_resolve_resolve-context.html +4 -7
- package/typedoc/modules/router_state-filters.html +4 -7
- package/typedoc/modules/router_state-provider.html +4 -7
- package/typedoc/modules/router_state_interface.html +4 -7
- package/typedoc/modules/router_state_state-builder.html +4 -7
- package/typedoc/modules/router_state_state-matcher.html +4 -7
- package/typedoc/modules/router_state_state-object.html +4 -7
- package/typedoc/modules/router_state_state-queue-manager.html +4 -7
- package/typedoc/modules/router_state_state-registry.html +4 -7
- package/typedoc/modules/router_state_state-service.html +4 -7
- package/typedoc/modules/router_state_target-state.html +4 -7
- package/typedoc/modules/router_state_views.html +4 -7
- package/typedoc/modules/router_template-factory.html +4 -7
- package/typedoc/modules/router_transition_hook-builder.html +4 -7
- package/typedoc/modules/router_transition_hook-registry.html +4 -7
- package/typedoc/modules/router_transition_interface.html +4 -7
- package/typedoc/modules/router_transition_reject-factory.html +4 -7
- package/typedoc/modules/router_transition_transition-event-type.html +4 -9
- package/typedoc/modules/router_transition_transition-hook.html +4 -7
- package/typedoc/modules/router_transition_transition-service.html +4 -9
- package/typedoc/modules/router_transition_transition.html +4 -7
- package/typedoc/modules/router_url_url-config.html +4 -7
- package/typedoc/modules/router_url_url-matcher.html +4 -7
- package/typedoc/modules/router_url_url-rule.html +4 -7
- package/typedoc/modules/router_url_url-rules.html +4 -7
- package/typedoc/modules/router_url_url-service.html +4 -7
- package/typedoc/modules/router_view-scroll.html +4 -7
- package/typedoc/modules/router_view_interface.html +4 -7
- package/typedoc/modules/router_view_view.html +4 -7
- package/typedoc/modules/services_anchor-scroll.html +4 -7
- package/typedoc/modules/services_browser.html +4 -7
- package/typedoc/modules/services_cookie-reader.html +4 -7
- package/typedoc/modules/services_http-backend_http-backend.html +4 -7
- package/typedoc/modules/services_http_http.html +4 -7
- package/typedoc/modules/services_log.html +4 -7
- package/typedoc/modules/services_template-request.html +4 -7
- package/typedoc/modules/shared_common.html +4 -7
- package/typedoc/modules/shared_constants.html +4 -7
- package/typedoc/modules/shared_dom.html +4 -7
- package/typedoc/modules/shared_hof.html +4 -7
- package/typedoc/modules/shared_interface.html +4 -7
- package/typedoc/modules/shared_noderef.html +4 -7
- package/typedoc/modules/shared_predicates.html +4 -7
- package/typedoc/modules/shared_strings.html +4 -7
- package/typedoc/modules/shared_test-utils.html +4 -7
- package/typedoc/modules/shared_utils.html +4 -34
- package/typedoc/modules.html +31 -8
- package/typedoc/types/animations_animate.AnimationMethod.html +4 -18
- package/typedoc/types/animations_interface.RafScheduler.html +4 -40
- package/typedoc/types/core_cache_cache-factory.TemplateCache.html +4 -18
- package/typedoc/types/core_compile_compile.ApplyDirectivesToNodeFn.html +4 -18
- package/typedoc/types/core_compile_compile.BoundTranscludeFn.html +4 -18
- package/typedoc/types/core_compile_compile.CompileFn.html +4 -18
- package/typedoc/types/core_compile_compile.CompileNodesFn.html +4 -18
- package/typedoc/types/core_compile_compile.CompositeLinkFn.html +4 -18
- package/typedoc/types/core_compile_compile.NodeLinkFn.html +4 -18
- package/typedoc/types/core_compile_compile.PublicLinkFn.html +4 -18
- package/typedoc/types/core_compile_compile.TranscludeFn.html +4 -18
- package/typedoc/types/core_error-handler.ErrorHandler.html +4 -18
- package/typedoc/types/core_exception-handler.LogService.html +4 -18
- package/typedoc/types/core_parse_ast_ast-node.ASTNode.html +4 -293
- package/typedoc/types/core_parse_interface.CompiledExpression.html +4 -18
- package/typedoc/types/core_parse_interface.CompiledExpressionFunction.html +7 -20
- package/typedoc/types/core_parse_interface.ParseService.html +7 -20
- package/typedoc/types/core_parse_interpreter.DecoratedASTNode.html +4 -18
- package/typedoc/types/core_scope_scope.ListenerFunction.html +4 -18
- package/typedoc/types/{interface.AnnotatedFactory.html → core_task-tracker-factory.AnnotatedFactory.html} +9 -19
- package/typedoc/types/core_url-utils_url-utils.HttpProtocol.html +4 -18
- package/typedoc/types/interface.CloneAttachFunction.html +4 -18
- package/typedoc/types/interface.ControllerConstructor.html +5 -19
- package/typedoc/types/interface.DirectiveCompileFn.html +4 -18
- package/typedoc/types/interface.DirectiveController.html +4 -18
- package/typedoc/types/interface.DirectiveFactory.html +4 -18
- package/typedoc/types/interface.DirectiveLinkFn.html +4 -18
- package/typedoc/types/interface.Expression.html +4 -18
- package/typedoc/types/interface.FilterFactory.html +4 -18
- package/typedoc/types/interface.FilterFn.html +4 -18
- package/typedoc/types/interface.Injectable.html +5 -19
- package/typedoc/types/interface.InjectableFactory.html +5 -19
- package/typedoc/types/interface.OnChangesObject.html +4 -18
- package/typedoc/types/interface.TController.html +4 -18
- package/typedoc/types/router_resolve_interface.PolicyAsync.html +4 -18
- package/typedoc/types/router_resolve_interface.PolicyWhen.html +4 -18
- package/typedoc/types/router_state_interface.RedirectToResult.html +4 -18
- package/typedoc/types/router_state_interface.ResolveTypes.html +4 -18
- package/typedoc/types/router_state_interface.StateOrName.html +4 -18
- package/typedoc/types/router_state_interface._StateDeclaration.html +4 -18
- package/typedoc/types/router_transition_interface.HookFn.html +4 -18
- package/typedoc/types/router_transition_interface.HookMatchCriterion.html +4 -18
- package/typedoc/types/router_transition_interface.HookResult.html +4 -18
- package/typedoc/types/router_transition_interface.IHookRegistration.html +4 -18
- package/typedoc/types/router_transition_interface.IStateMatch.html +4 -18
- package/typedoc/types/services_anchor-scroll.AnchorScrollFunction.html +4 -18
- package/typedoc/types/services_anchor-scroll.AnchorScrollService.html +4 -18
- package/typedoc/types/services_browser.UrlChangeListener.html +4 -18
- package/typedoc/types/services_log.LogCall.html +4 -18
- package/typedoc/types/shared_interface.Mapper.html +4 -18
- package/typedoc/types/shared_interface.Predicate.html +4 -18
- package/typedoc/types/shared_interface.PredicateBinary.html +4 -18
- package/typedoc/variables/animations_shared.ACTIVE_CLASS_SUFFIX.html +4 -18
- package/typedoc/variables/animations_shared.ADD_CLASS_SUFFIX.html +4 -18
- package/typedoc/variables/animations_shared.ANIMATIONEND_EVENT.html +4 -18
- package/typedoc/variables/animations_shared.ANIMATION_DELAY_PROP.html +4 -18
- package/typedoc/variables/animations_shared.ANIMATION_DURATION_PROP.html +4 -18
- package/typedoc/variables/animations_shared.ANIMATION_ITERATION_COUNT_KEY.html +4 -18
- package/typedoc/variables/animations_shared.ANIMATION_PLAYSTATE_KEY.html +4 -18
- package/typedoc/variables/animations_shared.ANIMATION_PROP.html +4 -18
- package/typedoc/variables/animations_shared.CSS_PREFIX.html +4 -18
- package/typedoc/variables/animations_shared.DELAY_KEY.html +4 -18
- package/typedoc/variables/animations_shared.DURATION_KEY.html +4 -18
- package/typedoc/variables/animations_shared.EVENT_CLASS_PREFIX.html +4 -18
- package/typedoc/variables/animations_shared.NG_ANIMATE_CHILDREN_DATA.html +4 -18
- package/typedoc/variables/animations_shared.NG_ANIMATE_CLASSNAME.html +4 -18
- package/typedoc/variables/animations_shared.PREPARE_CLASS_SUFFIX.html +4 -18
- package/typedoc/variables/animations_shared.PROPERTY_KEY.html +4 -18
- package/typedoc/variables/animations_shared.REMOVE_CLASS_SUFFIX.html +4 -18
- package/typedoc/variables/animations_shared.SAFE_FAST_FORWARD_DURATION_VALUE.html +4 -18
- package/typedoc/variables/animations_shared.TIMING_KEY.html +4 -18
- package/typedoc/variables/animations_shared.TRANSITIONEND_EVENT.html +4 -18
- package/typedoc/variables/animations_shared.TRANSITION_DELAY_PROP.html +4 -18
- package/typedoc/variables/animations_shared.TRANSITION_DURATION_PROP.html +4 -18
- package/typedoc/variables/animations_shared.TRANSITION_PROP.html +4 -18
- package/typedoc/variables/animations_shared.ngMinErr.html +4 -18
- package/typedoc/variables/core_cache_cache.Cache.html +4 -18
- package/typedoc/variables/core_cache_cache.EXPANDO.html +4 -18
- package/typedoc/variables/core_cache_cache.ISOLATE_SCOPE_KEY.html +4 -18
- package/typedoc/variables/core_cache_cache.SCOPE_KEY.html +4 -18
- package/typedoc/variables/core_compile_compile.DirectiveSuffix.html +4 -18
- package/typedoc/variables/core_di_ng-module.ANIMATION_LITERAL.html +4 -18
- package/typedoc/variables/core_di_ng-module.COMPILE_LITERAL.html +4 -18
- package/typedoc/variables/core_di_ng-module.CONTROLLER_LITERAL.html +4 -18
- package/typedoc/variables/core_di_ng-module.FILTER_LITERAL.html +4 -18
- package/typedoc/variables/core_di_ng-module.INJECTOR_LITERAL.html +4 -18
- package/typedoc/variables/core_parse_interpreter.PURITY_ABSOLUTE.html +4 -18
- package/typedoc/variables/core_parse_interpreter.PURITY_RELATIVE.html +4 -18
- package/typedoc/variables/core_pubsub_pubsub.EventBus.html +4 -18
- package/typedoc/variables/core_sce_sce.SCE_CONTEXTS.html +4 -18
- package/typedoc/variables/core_scope_scope.NONSCOPE.html +4 -18
- package/typedoc/variables/core_scope_scope.__applyAsyncQueue.html +4 -18
- package/typedoc/variables/core_scope_scope._postUpdateQueue.html +4 -18
- package/typedoc/variables/directive_attrs_attrs.REGEX_STRING_REGEXP.html +4 -18
- package/typedoc/variables/directive_attrs_attrs.ngAttributeAliasDirectives.html +4 -18
- package/typedoc/variables/directive_class_class.ngClassDirective.html +4 -18
- package/typedoc/variables/directive_class_class.ngClassEvenDirective.html +4 -18
- package/typedoc/variables/directive_class_class.ngClassOddDirective.html +4 -18
- package/typedoc/variables/directive_events_events.ngEventDirectives.html +4 -18
- package/typedoc/variables/directive_form_form.PENDING_CLASS.html +4 -18
- package/typedoc/variables/directive_form_form.formDirective.html +4 -18
- package/typedoc/variables/directive_form_form.ngFormDirective.html +4 -18
- package/typedoc/variables/directive_form_form.nullFormCtrl.html +4 -18
- package/typedoc/variables/directive_input_input.EMAIL_REGEXP.html +4 -18
- package/typedoc/variables/directive_input_input.ISO_DATE_REGEXP.html +4 -18
- package/typedoc/variables/directive_input_input.URL_REGEXP.html +4 -18
- package/typedoc/variables/directive_input_input.VALIDITY_STATE_PROPERTY.html +4 -18
- package/typedoc/variables/directive_messages_messages.ngMessageDefaultDirective.html +4 -18
- package/typedoc/variables/directive_messages_messages.ngMessageDirective.html +4 -18
- package/typedoc/variables/directive_messages_messages.ngMessageExpDirective.html +4 -18
- package/typedoc/variables/directive_model-options_model-options.defaultModelOptions.html +4 -18
- package/typedoc/variables/directive_model_model.ngModelMinErr.html +4 -18
- package/typedoc/variables/directive_options_options.ngOptionsDirective.html +20 -22
- package/typedoc/variables/directive_transclude_transclude.ngTranscludeDirective.html +4 -18
- package/typedoc/variables/directive_validators_validators.maxlengthDirective.html +4 -18
- package/typedoc/variables/directive_validators_validators.minlengthDirective.html +4 -18
- package/typedoc/variables/directive_validators_validators.patternDirective.html +4 -18
- package/typedoc/variables/directive_validators_validators.requiredDirective.html +4 -18
- package/typedoc/variables/{core_di_injector.path.html → injection-tokens._injectTokens.html} +28 -24
- package/typedoc/variables/public.VERSION.html +4 -18
- package/typedoc/variables/router_common_trace.trace.html +4 -18
- package/typedoc/variables/router_directives_view-directive.ngView.html +4 -23
- package/typedoc/variables/router_hooks_resolve.RESOLVE_HOOK_PRIORITY.html +4 -18
- package/typedoc/variables/router_params_param.DefType.html +4 -18
- package/typedoc/variables/router_resolve_resolvable.defaultResolvePolicy.html +4 -18
- package/typedoc/variables/router_resolve_resolve-context.resolvePolicies.html +4 -18
- package/typedoc/variables/router_transition_transition-service.defaultTransOpts.html +4 -18
- package/typedoc/variables/services_log.LogService.html +4 -25
- package/typedoc/variables/shared_common.assertMap.html +4 -18
- package/typedoc/variables/shared_common.assertPredicate.html +4 -18
- package/typedoc/variables/shared_common.pushTo.html +4 -18
- package/typedoc/variables/shared_common.removeFrom.html +4 -18
- package/typedoc/variables/shared_constants.ALIASED_ATTR.html +4 -18
- package/typedoc/variables/shared_constants.DIRTY_CLASS.html +4 -18
- package/typedoc/variables/shared_constants.EMPTY_CLASS.html +4 -18
- package/typedoc/variables/shared_constants.INVALID_CLASS.html +4 -18
- package/typedoc/variables/shared_constants.NOT_EMPTY_CLASS.html +4 -18
- package/typedoc/variables/shared_constants.PREFIX_REGEXP.html +4 -18
- package/typedoc/variables/shared_constants.PRISTINE_CLASS.html +4 -18
- package/typedoc/variables/shared_constants.SPECIAL_CHARS_REGEXP.html +4 -18
- package/typedoc/variables/shared_constants.TOUCHED_CLASS.html +4 -18
- package/typedoc/variables/shared_constants.UNTOUCHED_CLASS.html +4 -18
- package/typedoc/variables/shared_constants.VALID_CLASS.html +4 -18
- package/typedoc/variables/shared_dom.BOOLEAN_ATTR.html +4 -18
- package/typedoc/variables/shared_hof.propEq.html +4 -18
- package/typedoc/variables/shared_strings.hostRegex.html +4 -18
- package/typedoc/variables/shared_strings.splitEqual.html +4 -18
- package/typedoc/variables/shared_strings.splitHash.html +4 -18
- package/typedoc/variables/shared_strings.splitQuery.html +4 -18
- package/typedoc/variables/shared_utils.isProxySymbol.html +4 -18
- package/typedoc/variables/shared_utils.ngAttrPrefixes.html +4 -18
- package/typedoc.json +3 -1
- package/SECURITY.md +0 -16
- package/TODO.md +0 -13
- package/docs/content/en/about/featured-background.jpg +0 -0
- package/docs/content/en/about/index.md +0 -37
- package/docs/content/en/blog/_index.md +0 -8
- package/docs/content/en/blog/news/_index.md +0 -4
- package/docs/content/en/blog/news/first-post/featured-sunset-get.png +0 -0
- package/docs/content/en/blog/news/first-post/index.md +0 -46
- package/docs/content/en/blog/news/second-post.md +0 -238
- package/docs/content/en/blog/releases/_index.md +0 -4
- package/docs/content/en/blog/releases/in-depth-monoliths-detailed-spec.md +0 -238
- package/docs/content/en/community/_index.md +0 -6
- package/docs/content/en/docs/concepts/_index.md +0 -14
- package/docs/content/en/docs/contribution-guidelines/_index.md +0 -77
- package/docs/content/en/docs/examples/_index.md +0 -13
- package/docs/content/en/docs/getting-started/_index.md +0 -35
- package/docs/content/en/docs/getting-started/example-page.md +0 -231
- package/docs/content/en/docs/overview/_index.md +0 -34
- package/docs/content/en/docs/reference/_index.md +0 -12
- package/docs/content/en/docs/reference/parameter-reference.md +0 -207
- package/docs/content/en/docs/tasks/Ponycopters/_index.md +0 -12
- package/docs/content/en/docs/tasks/Ponycopters/configuring-ponycopters.md +0 -230
- package/docs/content/en/docs/tasks/Ponycopters/launching-ponycopters.md +0 -230
- package/docs/content/en/docs/tasks/_index.md +0 -21
- package/docs/content/en/docs/tasks/beds.md +0 -230
- package/docs/content/en/docs/tasks/porridge.md +0 -230
- package/docs/content/en/docs/tasks/task.md +0 -230
- package/docs/content/en/docs/tutorials/_index.md +0 -12
- package/docs/content/en/docs/tutorials/multi-bear.md +0 -230
- package/docs/content/en/docs/tutorials/tutorial2.md +0 -230
- package/docs/content/en/featured-background.jpg +0 -0
- package/docs/content/en/search.md +0 -4
- package/docs/layouts/_default/_markup/render-heading.html +0 -1
- package/public/public/legacy.html +0 -13203
- package/typedoc/functions/shared_utils.replaceInline.html +0 -331
- package/typedoc/variables/core_di_ng-module.PROVIDE_LITERAL.html +0 -263
|
@@ -94,7 +94,7 @@ describe("$compile", () => {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
function registerDirectives() {
|
|
97
|
-
|
|
97
|
+
const args = arguments;
|
|
98
98
|
myModule = window.angular.module("myModule", [
|
|
99
99
|
"ng",
|
|
100
100
|
function ($compileProvider) {
|
|
@@ -228,7 +228,7 @@ describe("$compile", () => {
|
|
|
228
228
|
myModule.directive("testing", () => ({ d: "one" }));
|
|
229
229
|
myModule.directive("testing", () => ({ d: "two" }));
|
|
230
230
|
reloadModules();
|
|
231
|
-
|
|
231
|
+
const result = injector.get("testingDirective");
|
|
232
232
|
expect(result.length).toBe(2);
|
|
233
233
|
expect(result[0].d).toEqual("one");
|
|
234
234
|
expect(result[1].d).toEqual("two");
|
|
@@ -258,7 +258,6 @@ describe("$compile", () => {
|
|
|
258
258
|
let el;
|
|
259
259
|
myModule.directive("myDirective", () => {
|
|
260
260
|
return {
|
|
261
|
-
restrict: "EA",
|
|
262
261
|
compile: function (element) {
|
|
263
262
|
el = element;
|
|
264
263
|
},
|
|
@@ -272,7 +271,6 @@ describe("$compile", () => {
|
|
|
272
271
|
it("compiles element directives from a single element", () => {
|
|
273
272
|
myModule.directive("myDirective", () => {
|
|
274
273
|
return {
|
|
275
|
-
restrict: "EA",
|
|
276
274
|
compile: function (element) {
|
|
277
275
|
setCacheData(element, "hasCompiled", true);
|
|
278
276
|
},
|
|
@@ -280,23 +278,22 @@ describe("$compile", () => {
|
|
|
280
278
|
});
|
|
281
279
|
reloadModules();
|
|
282
280
|
|
|
283
|
-
|
|
281
|
+
const el = $("<my-directive></my-directive>");
|
|
284
282
|
$compile(el);
|
|
285
283
|
expect(getCacheData(el, "hasCompiled")).toBe(true);
|
|
286
284
|
});
|
|
287
285
|
|
|
288
286
|
it("compiles element directives found from several elements", () => {
|
|
289
|
-
|
|
287
|
+
let idx = 1;
|
|
290
288
|
myModule.directive("myDirective", () => {
|
|
291
289
|
return {
|
|
292
|
-
restrict: "EA",
|
|
293
290
|
compile: function (element) {
|
|
294
291
|
setCacheData(element, "idx", idx++);
|
|
295
292
|
},
|
|
296
293
|
};
|
|
297
294
|
});
|
|
298
295
|
reloadModules();
|
|
299
|
-
|
|
296
|
+
const el = $(
|
|
300
297
|
"<div><my-directive></my-directive><my-directive></my-directive></div>",
|
|
301
298
|
);
|
|
302
299
|
$compile(el);
|
|
@@ -305,10 +302,9 @@ describe("$compile", () => {
|
|
|
305
302
|
});
|
|
306
303
|
|
|
307
304
|
it("compiles element directives from child elements", () => {
|
|
308
|
-
|
|
305
|
+
let idx = 1;
|
|
309
306
|
myModule.directive("myDirective", () => {
|
|
310
307
|
return {
|
|
311
|
-
restrict: "EA",
|
|
312
308
|
compile: function (element) {
|
|
313
309
|
setCacheData(element, "dir", idx++);
|
|
314
310
|
},
|
|
@@ -316,7 +312,7 @@ describe("$compile", () => {
|
|
|
316
312
|
});
|
|
317
313
|
reloadModules();
|
|
318
314
|
|
|
319
|
-
|
|
315
|
+
const el = $("<div><my-directive></my-directive></div>");
|
|
320
316
|
$compile(el);
|
|
321
317
|
expect(getCacheData(el, "dir")).toBeUndefined();
|
|
322
318
|
|
|
@@ -324,17 +320,16 @@ describe("$compile", () => {
|
|
|
324
320
|
});
|
|
325
321
|
|
|
326
322
|
it("compiles nested directives", () => {
|
|
327
|
-
|
|
323
|
+
let idx = 1;
|
|
328
324
|
myModule.directive("myDir", () => {
|
|
329
325
|
return {
|
|
330
|
-
restrict: "EA",
|
|
331
326
|
compile: function (element) {
|
|
332
327
|
setCacheData(element, "dir", idx++);
|
|
333
328
|
},
|
|
334
329
|
};
|
|
335
330
|
});
|
|
336
331
|
reloadModules();
|
|
337
|
-
|
|
332
|
+
const el = $("<my-dir><my-dir><my-dir></my-dir></my-dir></my-dir>");
|
|
338
333
|
$compile(el);
|
|
339
334
|
expect(getCacheData(el, "dir")).toBe(1);
|
|
340
335
|
expect(getCacheData(el.firstChild, "dir")).toBe(2);
|
|
@@ -348,14 +343,13 @@ describe("$compile", () => {
|
|
|
348
343
|
() => {
|
|
349
344
|
myModule.directive("myDirective", () => {
|
|
350
345
|
return {
|
|
351
|
-
restrict: "EA",
|
|
352
346
|
compile: function (element) {
|
|
353
347
|
setCacheData(element, "hasCompiled", true);
|
|
354
348
|
},
|
|
355
349
|
};
|
|
356
350
|
});
|
|
357
351
|
reloadModules();
|
|
358
|
-
|
|
352
|
+
const el = $(
|
|
359
353
|
"<" +
|
|
360
354
|
prefix +
|
|
361
355
|
delim +
|
|
@@ -374,7 +368,6 @@ describe("$compile", () => {
|
|
|
374
368
|
it("compiles attribute directives", () => {
|
|
375
369
|
myModule.directive("myDirective", () => {
|
|
376
370
|
return {
|
|
377
|
-
restrict: "EA",
|
|
378
371
|
compile: function (element) {
|
|
379
372
|
setCacheData(element, "hasCompiled", true);
|
|
380
373
|
},
|
|
@@ -382,7 +375,7 @@ describe("$compile", () => {
|
|
|
382
375
|
});
|
|
383
376
|
|
|
384
377
|
reloadModules();
|
|
385
|
-
|
|
378
|
+
const el = $("<div my-directive></div>");
|
|
386
379
|
$compile(el);
|
|
387
380
|
expect(getCacheData(el, "hasCompiled")).toBe(true);
|
|
388
381
|
});
|
|
@@ -390,14 +383,13 @@ describe("$compile", () => {
|
|
|
390
383
|
it("compiles attribute directives with prefixes", () => {
|
|
391
384
|
myModule.directive("myDirective", () => {
|
|
392
385
|
return {
|
|
393
|
-
restrict: "EA",
|
|
394
386
|
compile: function (element) {
|
|
395
387
|
setCacheData(element, "hasCompiled", true);
|
|
396
388
|
},
|
|
397
389
|
};
|
|
398
390
|
});
|
|
399
391
|
reloadModules();
|
|
400
|
-
|
|
392
|
+
const el = $("<div my-directive></div>");
|
|
401
393
|
$compile(el);
|
|
402
394
|
expect(getCacheData(el, "hasCompiled")).toBe(true);
|
|
403
395
|
});
|
|
@@ -406,7 +398,6 @@ describe("$compile", () => {
|
|
|
406
398
|
myModule
|
|
407
399
|
.directive("myDirective", () => {
|
|
408
400
|
return {
|
|
409
|
-
restrict: "EA",
|
|
410
401
|
compile: function (element) {
|
|
411
402
|
setCacheData(element, "hasCompiled", true);
|
|
412
403
|
},
|
|
@@ -414,14 +405,13 @@ describe("$compile", () => {
|
|
|
414
405
|
})
|
|
415
406
|
.directive("mySecondDirective", () => {
|
|
416
407
|
return {
|
|
417
|
-
restrict: "EA",
|
|
418
408
|
compile: function (element) {
|
|
419
409
|
setCacheData(element, "secondCompiled", true);
|
|
420
410
|
},
|
|
421
411
|
};
|
|
422
412
|
});
|
|
423
413
|
reloadModules();
|
|
424
|
-
|
|
414
|
+
const el = $("<div my-directive my-second-directive></div>");
|
|
425
415
|
$compile(el);
|
|
426
416
|
expect(getCacheData(el, "hasCompiled")).toBe(true);
|
|
427
417
|
expect(getCacheData(el, "secondCompiled")).toBe(true);
|
|
@@ -431,7 +421,6 @@ describe("$compile", () => {
|
|
|
431
421
|
myModule
|
|
432
422
|
.directive("myDirective", () => {
|
|
433
423
|
return {
|
|
434
|
-
restrict: "EA",
|
|
435
424
|
compile: function (element) {
|
|
436
425
|
setCacheData(element, "hasCompiled", true);
|
|
437
426
|
},
|
|
@@ -439,7 +428,6 @@ describe("$compile", () => {
|
|
|
439
428
|
})
|
|
440
429
|
.directive("mySecondDirective", () => {
|
|
441
430
|
return {
|
|
442
|
-
restrict: "EA",
|
|
443
431
|
compile: function (element) {
|
|
444
432
|
setCacheData(element, "secondCompiled", true);
|
|
445
433
|
},
|
|
@@ -447,7 +435,7 @@ describe("$compile", () => {
|
|
|
447
435
|
});
|
|
448
436
|
|
|
449
437
|
reloadModules();
|
|
450
|
-
|
|
438
|
+
const el = $("<my-directive my-second-directive></my-directive>");
|
|
451
439
|
$compile(el);
|
|
452
440
|
expect(getCacheData(el, "hasCompiled")).toBe(true);
|
|
453
441
|
expect(getCacheData(el, "secondCompiled")).toBe(true);
|
|
@@ -456,14 +444,13 @@ describe("$compile", () => {
|
|
|
456
444
|
it("compiles attribute directives with ng-attr prefix", () => {
|
|
457
445
|
myModule.directive("myDirective", () => {
|
|
458
446
|
return {
|
|
459
|
-
restrict: "EA",
|
|
460
447
|
compile: function (element) {
|
|
461
448
|
setCacheData(element, "hasCompiled", true);
|
|
462
449
|
},
|
|
463
450
|
};
|
|
464
451
|
});
|
|
465
452
|
reloadModules();
|
|
466
|
-
|
|
453
|
+
const el = $("<div ng-attr-my-directive></div>");
|
|
467
454
|
$compile(el);
|
|
468
455
|
expect(getCacheData(el, "hasCompiled")).toBe(true);
|
|
469
456
|
});
|
|
@@ -471,14 +458,13 @@ describe("$compile", () => {
|
|
|
471
458
|
it("compiles attribute directives with ng-attr prefix", () => {
|
|
472
459
|
myModule.directive("myDirective", () => {
|
|
473
460
|
return {
|
|
474
|
-
restrict: "EA",
|
|
475
461
|
compile: function (element) {
|
|
476
462
|
setCacheData(element, "hasCompiled", true);
|
|
477
463
|
},
|
|
478
464
|
};
|
|
479
465
|
});
|
|
480
466
|
reloadModules();
|
|
481
|
-
|
|
467
|
+
const el = $("<div ng-attr-my-directive></div>");
|
|
482
468
|
$compile(el);
|
|
483
469
|
expect(getCacheData(el, "hasCompiled")).toBe(true);
|
|
484
470
|
});
|
|
@@ -496,7 +482,7 @@ describe("$compile", () => {
|
|
|
496
482
|
it(
|
|
497
483
|
(expected[type] ? "matches" : "does not match") + " on " + type,
|
|
498
484
|
() => {
|
|
499
|
-
|
|
485
|
+
let hasCompiled = false;
|
|
500
486
|
myModule.directive("myDirective", () => {
|
|
501
487
|
return {
|
|
502
488
|
restrict: restrict,
|
|
@@ -515,7 +501,7 @@ describe("$compile", () => {
|
|
|
515
501
|
});
|
|
516
502
|
|
|
517
503
|
it("applies to attributes when no restrict given", () => {
|
|
518
|
-
|
|
504
|
+
let hasCompiled = false;
|
|
519
505
|
myModule.directive("myDirective", () => {
|
|
520
506
|
return {
|
|
521
507
|
compile: () => {
|
|
@@ -524,13 +510,13 @@ describe("$compile", () => {
|
|
|
524
510
|
};
|
|
525
511
|
});
|
|
526
512
|
reloadModules();
|
|
527
|
-
|
|
513
|
+
const el = $("<div my-directive></div>");
|
|
528
514
|
$compile(el);
|
|
529
515
|
expect(hasCompiled).toBe(true);
|
|
530
516
|
});
|
|
531
517
|
|
|
532
518
|
it("applies to elements when no restrict given", () => {
|
|
533
|
-
|
|
519
|
+
let hasCompiled = false;
|
|
534
520
|
myModule.directive("myDirective", () => {
|
|
535
521
|
return {
|
|
536
522
|
compile: () => {
|
|
@@ -539,13 +525,13 @@ describe("$compile", () => {
|
|
|
539
525
|
};
|
|
540
526
|
});
|
|
541
527
|
reloadModules();
|
|
542
|
-
|
|
528
|
+
const el = $("<my-directive></my-directive>");
|
|
543
529
|
$compile(el);
|
|
544
530
|
expect(hasCompiled).toBe(true);
|
|
545
531
|
});
|
|
546
532
|
|
|
547
533
|
it("does not apply to classes when no restrict given", () => {
|
|
548
|
-
|
|
534
|
+
let hasCompiled = false;
|
|
549
535
|
myModule.directive("myDirective", () => {
|
|
550
536
|
return {
|
|
551
537
|
compile: () => {
|
|
@@ -554,13 +540,13 @@ describe("$compile", () => {
|
|
|
554
540
|
};
|
|
555
541
|
});
|
|
556
542
|
reloadModules();
|
|
557
|
-
|
|
543
|
+
const el = $('<div class="my-directive"></div>');
|
|
558
544
|
$compile(el);
|
|
559
545
|
expect(hasCompiled).toBe(false);
|
|
560
546
|
});
|
|
561
547
|
|
|
562
548
|
it("applies in priority order", () => {
|
|
563
|
-
|
|
549
|
+
const compilations = [];
|
|
564
550
|
myModule
|
|
565
551
|
.directive("lowerDirective", () => {
|
|
566
552
|
return {
|
|
@@ -579,13 +565,13 @@ describe("$compile", () => {
|
|
|
579
565
|
};
|
|
580
566
|
});
|
|
581
567
|
reloadModules();
|
|
582
|
-
|
|
568
|
+
const el = $("<div lower-directive higher-directive></div>");
|
|
583
569
|
$compile(el);
|
|
584
570
|
expect(compilations).toEqual(["higher", "lower"]);
|
|
585
571
|
});
|
|
586
572
|
|
|
587
573
|
it("applies in name order when priorities are the same", () => {
|
|
588
|
-
|
|
574
|
+
const compilations = [];
|
|
589
575
|
myModule
|
|
590
576
|
.directive("firstDirective", () => {
|
|
591
577
|
return {
|
|
@@ -609,7 +595,7 @@ describe("$compile", () => {
|
|
|
609
595
|
});
|
|
610
596
|
|
|
611
597
|
it("applies in registration order when names are the same", () => {
|
|
612
|
-
|
|
598
|
+
const compilations = [];
|
|
613
599
|
myModule
|
|
614
600
|
.directive("aDirective", () => {
|
|
615
601
|
return {
|
|
@@ -633,7 +619,7 @@ describe("$compile", () => {
|
|
|
633
619
|
});
|
|
634
620
|
|
|
635
621
|
it("uses default priority when one not given", () => {
|
|
636
|
-
|
|
622
|
+
const compilations = [];
|
|
637
623
|
myModule
|
|
638
624
|
.directive("firstDirective", () => {
|
|
639
625
|
return {
|
|
@@ -656,7 +642,7 @@ describe("$compile", () => {
|
|
|
656
642
|
});
|
|
657
643
|
|
|
658
644
|
it("stops compiling at a terminal directive", () => {
|
|
659
|
-
|
|
645
|
+
const compilations = [];
|
|
660
646
|
|
|
661
647
|
myModule
|
|
662
648
|
.directive("firstDirective", () => {
|
|
@@ -682,7 +668,7 @@ describe("$compile", () => {
|
|
|
682
668
|
});
|
|
683
669
|
|
|
684
670
|
it("still compiles directives with same priority after terminal", () => {
|
|
685
|
-
|
|
671
|
+
const compilations = [];
|
|
686
672
|
myModule
|
|
687
673
|
.directive("firstDirective", () => {
|
|
688
674
|
return {
|
|
@@ -707,7 +693,7 @@ describe("$compile", () => {
|
|
|
707
693
|
});
|
|
708
694
|
|
|
709
695
|
it("stops child compilation after a terminal directive", () => {
|
|
710
|
-
|
|
696
|
+
const compilations = [];
|
|
711
697
|
myModule
|
|
712
698
|
.directive("parentDirective", () => {
|
|
713
699
|
return {
|
|
@@ -740,7 +726,7 @@ describe("$compile", () => {
|
|
|
740
726
|
|
|
741
727
|
it("should allow multiple directives per element", () => {
|
|
742
728
|
reloadModules();
|
|
743
|
-
|
|
729
|
+
const el = $(
|
|
744
730
|
"<span greet='angular' log='L' high-log='H' data-medium-log='M'></span>",
|
|
745
731
|
);
|
|
746
732
|
$compile(el)($rootScope);
|
|
@@ -827,17 +813,16 @@ describe("$compile", () => {
|
|
|
827
813
|
* @param {*} callback A callback to invoke when it’s all done
|
|
828
814
|
*/
|
|
829
815
|
function registerAndCompile(dirName, domString, callback) {
|
|
830
|
-
|
|
816
|
+
let givenAttrs;
|
|
831
817
|
registerDirectives(dirName, () => {
|
|
832
818
|
return {
|
|
833
|
-
restrict: "EA",
|
|
834
819
|
compile: function (element, attrs) {
|
|
835
820
|
givenAttrs = attrs;
|
|
836
821
|
},
|
|
837
822
|
};
|
|
838
823
|
});
|
|
839
824
|
reloadModules();
|
|
840
|
-
|
|
825
|
+
const el = $(domString);
|
|
841
826
|
$compile(el);
|
|
842
827
|
callback(el, givenAttrs, $rootScope);
|
|
843
828
|
}
|
|
@@ -929,7 +914,7 @@ describe("$compile", () => {
|
|
|
929
914
|
});
|
|
930
915
|
|
|
931
916
|
it("shares attributes between directives", () => {
|
|
932
|
-
|
|
917
|
+
let attrs1, attrs2;
|
|
933
918
|
registerDirectives({
|
|
934
919
|
myDir: () => {
|
|
935
920
|
return {
|
|
@@ -947,7 +932,7 @@ describe("$compile", () => {
|
|
|
947
932
|
},
|
|
948
933
|
});
|
|
949
934
|
reloadModules();
|
|
950
|
-
|
|
935
|
+
const el = $("<div my-dir my-other-dir></div>");
|
|
951
936
|
$compile(el);
|
|
952
937
|
expect(attrs1).toBe(attrs2);
|
|
953
938
|
});
|
|
@@ -1047,7 +1032,7 @@ describe("$compile", () => {
|
|
|
1047
1032
|
"myDirective",
|
|
1048
1033
|
'<my-directive some-attribute="42"></my-directive>',
|
|
1049
1034
|
function (element, attrs) {
|
|
1050
|
-
|
|
1035
|
+
let gotValue;
|
|
1051
1036
|
attrs.$observe("someAttribute", function (value) {
|
|
1052
1037
|
gotValue = value;
|
|
1053
1038
|
});
|
|
@@ -1063,7 +1048,7 @@ describe("$compile", () => {
|
|
|
1063
1048
|
"myDirective",
|
|
1064
1049
|
'<my-directive some-attribute="42"></my-directive>',
|
|
1065
1050
|
function (element, attrs, $rootScope) {
|
|
1066
|
-
|
|
1051
|
+
let gotValue;
|
|
1067
1052
|
attrs.$observe("someAttribute", function (value) {
|
|
1068
1053
|
gotValue = value;
|
|
1069
1054
|
});
|
|
@@ -1077,8 +1062,8 @@ describe("$compile", () => {
|
|
|
1077
1062
|
"myDirective",
|
|
1078
1063
|
'<my-directive some-attribute="42"></my-directive>',
|
|
1079
1064
|
function (element, attrs) {
|
|
1080
|
-
|
|
1081
|
-
|
|
1065
|
+
let gotValue;
|
|
1066
|
+
const remove = attrs.$observe("someAttribute", function (value) {
|
|
1082
1067
|
gotValue = value;
|
|
1083
1068
|
});
|
|
1084
1069
|
|
|
@@ -1144,8 +1129,8 @@ describe("$compile", () => {
|
|
|
1144
1129
|
return { compile: () => {} };
|
|
1145
1130
|
});
|
|
1146
1131
|
reloadModules();
|
|
1147
|
-
|
|
1148
|
-
|
|
1132
|
+
const el = $("<div my-directive></div>");
|
|
1133
|
+
const linkFn = $compile(el);
|
|
1149
1134
|
expect(linkFn).toBeDefined();
|
|
1150
1135
|
expect(isFunction(linkFn)).toBe(true);
|
|
1151
1136
|
});
|
|
@@ -1156,7 +1141,7 @@ describe("$compile", () => {
|
|
|
1156
1141
|
return { compile: () => {} };
|
|
1157
1142
|
});
|
|
1158
1143
|
reloadModules();
|
|
1159
|
-
|
|
1144
|
+
const el = $("<div my-directive></div>");
|
|
1160
1145
|
$compile(el)($rootScope);
|
|
1161
1146
|
await wait();
|
|
1162
1147
|
expect(getCacheData(el, "$scope")).toBe($rootScope);
|
|
@@ -1164,7 +1149,7 @@ describe("$compile", () => {
|
|
|
1164
1149
|
});
|
|
1165
1150
|
|
|
1166
1151
|
it("calls directive link function with scope", async () => {
|
|
1167
|
-
|
|
1152
|
+
let givenScope, givenElement, givenAttrs;
|
|
1168
1153
|
registerDirectives("myDirective", () => {
|
|
1169
1154
|
return {
|
|
1170
1155
|
compile: () => {
|
|
@@ -1177,7 +1162,7 @@ describe("$compile", () => {
|
|
|
1177
1162
|
};
|
|
1178
1163
|
});
|
|
1179
1164
|
reloadModules();
|
|
1180
|
-
|
|
1165
|
+
const el = $("<div my-directive></div>");
|
|
1181
1166
|
$compile(el)($rootScope);
|
|
1182
1167
|
await wait();
|
|
1183
1168
|
expect(givenScope).toBe($rootScope);
|
|
@@ -1187,7 +1172,7 @@ describe("$compile", () => {
|
|
|
1187
1172
|
});
|
|
1188
1173
|
|
|
1189
1174
|
it("supports link function in directive definition object", () => {
|
|
1190
|
-
|
|
1175
|
+
let givenScope, givenElement, givenAttrs;
|
|
1191
1176
|
registerDirectives("myDirective", () => {
|
|
1192
1177
|
return {
|
|
1193
1178
|
link: function (scope, element, attrs) {
|
|
@@ -1198,7 +1183,7 @@ describe("$compile", () => {
|
|
|
1198
1183
|
};
|
|
1199
1184
|
});
|
|
1200
1185
|
reloadModules();
|
|
1201
|
-
|
|
1186
|
+
const el = $("<div my-directive></div>");
|
|
1202
1187
|
$compile(el)($rootScope);
|
|
1203
1188
|
expect(givenScope).toBe($rootScope);
|
|
1204
1189
|
expect(givenElement).toBe(el);
|
|
@@ -1216,7 +1201,7 @@ describe("$compile", () => {
|
|
|
1216
1201
|
};
|
|
1217
1202
|
});
|
|
1218
1203
|
reloadModules();
|
|
1219
|
-
|
|
1204
|
+
const el = $("<div my-directive><div my-directive></div></div>");
|
|
1220
1205
|
$compile(el)($rootScope);
|
|
1221
1206
|
|
|
1222
1207
|
expect(givenElements.length).toBe(2);
|
|
@@ -1234,7 +1219,7 @@ describe("$compile", () => {
|
|
|
1234
1219
|
};
|
|
1235
1220
|
});
|
|
1236
1221
|
reloadModules();
|
|
1237
|
-
|
|
1222
|
+
const el = $(
|
|
1238
1223
|
"<div my-directive><div my-directive></div><div my-directive></div></div>",
|
|
1239
1224
|
);
|
|
1240
1225
|
$compile(el)($rootScope);
|
|
@@ -1247,7 +1232,7 @@ describe("$compile", () => {
|
|
|
1247
1232
|
});
|
|
1248
1233
|
|
|
1249
1234
|
it("links children when parent has no directives", async () => {
|
|
1250
|
-
|
|
1235
|
+
const givenElements = [];
|
|
1251
1236
|
registerDirectives("myDirective", () => {
|
|
1252
1237
|
return {
|
|
1253
1238
|
link: function (scope, element, attrs) {
|
|
@@ -1256,7 +1241,7 @@ describe("$compile", () => {
|
|
|
1256
1241
|
};
|
|
1257
1242
|
});
|
|
1258
1243
|
reloadModules();
|
|
1259
|
-
|
|
1244
|
+
const el = $("<div><div my-directive></div></div>");
|
|
1260
1245
|
$compile(el)($rootScope);
|
|
1261
1246
|
await wait();
|
|
1262
1247
|
expect(givenElements.length).toBe(1);
|
|
@@ -1264,7 +1249,7 @@ describe("$compile", () => {
|
|
|
1264
1249
|
});
|
|
1265
1250
|
|
|
1266
1251
|
it("links nested children when parent has no directives", async () => {
|
|
1267
|
-
|
|
1252
|
+
const givenElements = [];
|
|
1268
1253
|
registerDirectives("myDirective", () => {
|
|
1269
1254
|
return {
|
|
1270
1255
|
link: function (scope, element, attrs) {
|
|
@@ -1273,7 +1258,7 @@ describe("$compile", () => {
|
|
|
1273
1258
|
};
|
|
1274
1259
|
});
|
|
1275
1260
|
reloadModules();
|
|
1276
|
-
|
|
1261
|
+
const el = $(
|
|
1277
1262
|
`<div><div my-directive><div><div my-directive></div></div></div></div>`,
|
|
1278
1263
|
);
|
|
1279
1264
|
$compile(el)($rootScope);
|
|
@@ -1285,7 +1270,7 @@ describe("$compile", () => {
|
|
|
1285
1270
|
});
|
|
1286
1271
|
|
|
1287
1272
|
it("supports link function objects", () => {
|
|
1288
|
-
|
|
1273
|
+
let linked;
|
|
1289
1274
|
registerDirectives("myDirective", () => {
|
|
1290
1275
|
return {
|
|
1291
1276
|
link: {
|
|
@@ -1296,13 +1281,13 @@ describe("$compile", () => {
|
|
|
1296
1281
|
};
|
|
1297
1282
|
});
|
|
1298
1283
|
reloadModules();
|
|
1299
|
-
|
|
1284
|
+
const el = $("<div><div my-directive></div></div>");
|
|
1300
1285
|
$compile(el)($rootScope);
|
|
1301
1286
|
expect(linked).toBe(true);
|
|
1302
1287
|
});
|
|
1303
1288
|
|
|
1304
1289
|
it("supports prelinking and postlinking", () => {
|
|
1305
|
-
|
|
1290
|
+
const linkings = [];
|
|
1306
1291
|
registerDirectives("myDirective", () => {
|
|
1307
1292
|
return {
|
|
1308
1293
|
link: {
|
|
@@ -1316,7 +1301,7 @@ describe("$compile", () => {
|
|
|
1316
1301
|
};
|
|
1317
1302
|
});
|
|
1318
1303
|
reloadModules();
|
|
1319
|
-
|
|
1304
|
+
const el = $("<div my-directive><div my-directive></div></div>");
|
|
1320
1305
|
$compile(el)($rootScope);
|
|
1321
1306
|
expect(linkings.length).toBe(4);
|
|
1322
1307
|
// The order of the link function invocations is:
|
|
@@ -1331,7 +1316,7 @@ describe("$compile", () => {
|
|
|
1331
1316
|
});
|
|
1332
1317
|
|
|
1333
1318
|
it("reverses priority for postlink functions", () => {
|
|
1334
|
-
|
|
1319
|
+
const linkings = [];
|
|
1335
1320
|
registerDirectives({
|
|
1336
1321
|
firstDirective: () => {
|
|
1337
1322
|
return {
|
|
@@ -1361,7 +1346,7 @@ describe("$compile", () => {
|
|
|
1361
1346
|
},
|
|
1362
1347
|
});
|
|
1363
1348
|
reloadModules();
|
|
1364
|
-
|
|
1349
|
+
const el = $("<div first-directive second-directive></div>");
|
|
1365
1350
|
$compile(el)($rootScope);
|
|
1366
1351
|
expect(linkings).toEqual([
|
|
1367
1352
|
"first-pre",
|
|
@@ -1372,7 +1357,7 @@ describe("$compile", () => {
|
|
|
1372
1357
|
});
|
|
1373
1358
|
|
|
1374
1359
|
it("stabilizes node list during linking", () => {
|
|
1375
|
-
|
|
1360
|
+
const givenElements = [];
|
|
1376
1361
|
registerDirectives("myDirective", () => {
|
|
1377
1362
|
return {
|
|
1378
1363
|
link: function (scope, element, attrs) {
|
|
@@ -1382,8 +1367,8 @@ describe("$compile", () => {
|
|
|
1382
1367
|
};
|
|
1383
1368
|
});
|
|
1384
1369
|
reloadModules();
|
|
1385
|
-
|
|
1386
|
-
|
|
1370
|
+
const el = $("<div><div my-directive></div><div my-directive></div></div>");
|
|
1371
|
+
const el1 = el.childNodes[0],
|
|
1387
1372
|
el2 = el.childNodes[1];
|
|
1388
1373
|
$compile(el)($rootScope);
|
|
1389
1374
|
expect(givenElements.length).toBe(2);
|
|
@@ -1392,7 +1377,7 @@ describe("$compile", () => {
|
|
|
1392
1377
|
});
|
|
1393
1378
|
|
|
1394
1379
|
it("makes new scope for element when directive asks for it", () => {
|
|
1395
|
-
|
|
1380
|
+
let givenScope;
|
|
1396
1381
|
registerDirectives("myDirective", () => {
|
|
1397
1382
|
return {
|
|
1398
1383
|
scope: true,
|
|
@@ -1402,13 +1387,13 @@ describe("$compile", () => {
|
|
|
1402
1387
|
};
|
|
1403
1388
|
});
|
|
1404
1389
|
reloadModules();
|
|
1405
|
-
|
|
1390
|
+
const el = $("<div my-directive></div>");
|
|
1406
1391
|
$compile(el)($rootScope);
|
|
1407
1392
|
expect(givenScope.$parent.id).toBe($rootScope.id);
|
|
1408
1393
|
});
|
|
1409
1394
|
|
|
1410
1395
|
it("makes new scope for element when directive rejects it", () => {
|
|
1411
|
-
|
|
1396
|
+
let givenScope;
|
|
1412
1397
|
registerDirectives("myDirective", () => {
|
|
1413
1398
|
return {
|
|
1414
1399
|
scope: false,
|
|
@@ -1418,14 +1403,14 @@ describe("$compile", () => {
|
|
|
1418
1403
|
};
|
|
1419
1404
|
});
|
|
1420
1405
|
reloadModules();
|
|
1421
|
-
|
|
1406
|
+
const el = $("<div my-directive></div>");
|
|
1422
1407
|
$compile(el)($rootScope);
|
|
1423
1408
|
//A false value for scope is considered equivalent to undefined, i.e. should receive parent scope
|
|
1424
1409
|
expect(givenScope.id).toBe($rootScope.id);
|
|
1425
1410
|
});
|
|
1426
1411
|
|
|
1427
1412
|
it("gives inherited scope to all directives on element", () => {
|
|
1428
|
-
|
|
1413
|
+
let givenScope;
|
|
1429
1414
|
registerDirectives({
|
|
1430
1415
|
myDirective: () => {
|
|
1431
1416
|
return {
|
|
@@ -1441,13 +1426,13 @@ describe("$compile", () => {
|
|
|
1441
1426
|
},
|
|
1442
1427
|
});
|
|
1443
1428
|
reloadModules();
|
|
1444
|
-
|
|
1429
|
+
const el = $("<div my-directive my-other-directive></div>");
|
|
1445
1430
|
$compile(el)($rootScope);
|
|
1446
1431
|
expect(givenScope.$parent.$id).toBe($rootScope.$id);
|
|
1447
1432
|
});
|
|
1448
1433
|
|
|
1449
1434
|
it("adds new scope data for element with new scope", function () {
|
|
1450
|
-
|
|
1435
|
+
let givenScope;
|
|
1451
1436
|
registerDirectives("myDirective", function () {
|
|
1452
1437
|
return {
|
|
1453
1438
|
scope: true,
|
|
@@ -1457,13 +1442,13 @@ describe("$compile", () => {
|
|
|
1457
1442
|
};
|
|
1458
1443
|
});
|
|
1459
1444
|
reloadModules();
|
|
1460
|
-
|
|
1445
|
+
const el = $("<div my-directive></div>");
|
|
1461
1446
|
$compile(el)($rootScope);
|
|
1462
1447
|
expect(getScope(el)).toBe(givenScope);
|
|
1463
1448
|
});
|
|
1464
1449
|
|
|
1465
1450
|
it("adds new scope", async () => {
|
|
1466
|
-
|
|
1451
|
+
let givenScope;
|
|
1467
1452
|
registerDirectives("myDirective", () => {
|
|
1468
1453
|
return {
|
|
1469
1454
|
scope: true,
|
|
@@ -1473,14 +1458,14 @@ describe("$compile", () => {
|
|
|
1473
1458
|
};
|
|
1474
1459
|
});
|
|
1475
1460
|
reloadModules();
|
|
1476
|
-
|
|
1461
|
+
const el = $("<div my-directive></div>");
|
|
1477
1462
|
$compile(el)($rootScope);
|
|
1478
1463
|
await wait();
|
|
1479
1464
|
expect($rootScope.$children[0].$id).toBe(givenScope.$id);
|
|
1480
1465
|
});
|
|
1481
1466
|
|
|
1482
1467
|
it("creates an isolate scope when requested", () => {
|
|
1483
|
-
|
|
1468
|
+
let givenScope;
|
|
1484
1469
|
registerDirectives("myDirective", () => {
|
|
1485
1470
|
return {
|
|
1486
1471
|
scope: {},
|
|
@@ -1490,7 +1475,7 @@ describe("$compile", () => {
|
|
|
1490
1475
|
};
|
|
1491
1476
|
});
|
|
1492
1477
|
reloadModules();
|
|
1493
|
-
|
|
1478
|
+
const el = $("<div my-directive></div>");
|
|
1494
1479
|
$compile(el)($rootScope);
|
|
1495
1480
|
expect(givenScope.$parent.$id).toBe($rootScope.$id);
|
|
1496
1481
|
expect($rootScope.$children[0]).toBe(givenScope);
|
|
@@ -1498,7 +1483,7 @@ describe("$compile", () => {
|
|
|
1498
1483
|
});
|
|
1499
1484
|
|
|
1500
1485
|
it("does not share isolate scope with other directives on the element", () => {
|
|
1501
|
-
|
|
1486
|
+
let givenScope;
|
|
1502
1487
|
registerDirectives({
|
|
1503
1488
|
myDirective: () => {
|
|
1504
1489
|
return {
|
|
@@ -1514,14 +1499,14 @@ describe("$compile", () => {
|
|
|
1514
1499
|
},
|
|
1515
1500
|
});
|
|
1516
1501
|
reloadModules();
|
|
1517
|
-
|
|
1502
|
+
const el = $("<div my-directive my-other-directive></div>");
|
|
1518
1503
|
$compile(el)($rootScope);
|
|
1519
1504
|
expect(givenScope).toBeDefined();
|
|
1520
1505
|
expect(givenScope).toBe($rootScope);
|
|
1521
1506
|
});
|
|
1522
1507
|
|
|
1523
1508
|
it("does not use isolate scope on child elements", () => {
|
|
1524
|
-
|
|
1509
|
+
let givenScope;
|
|
1525
1510
|
registerDirectives({
|
|
1526
1511
|
myDirective: () => {
|
|
1527
1512
|
return {
|
|
@@ -1537,7 +1522,7 @@ describe("$compile", () => {
|
|
|
1537
1522
|
},
|
|
1538
1523
|
});
|
|
1539
1524
|
reloadModules();
|
|
1540
|
-
|
|
1525
|
+
const el = $("<div my-directive><div my-other-directive></div></div>");
|
|
1541
1526
|
$compile(el)($rootScope);
|
|
1542
1527
|
expect(givenScope).toBeDefined();
|
|
1543
1528
|
expect(givenScope).toBe($rootScope);
|
|
@@ -1557,7 +1542,7 @@ describe("$compile", () => {
|
|
|
1557
1542
|
},
|
|
1558
1543
|
});
|
|
1559
1544
|
reloadModules();
|
|
1560
|
-
|
|
1545
|
+
const el = $("<div my-directive my-other-directive></div>");
|
|
1561
1546
|
expect(() => {
|
|
1562
1547
|
$compile(el);
|
|
1563
1548
|
}).toThrowError();
|
|
@@ -1577,14 +1562,14 @@ describe("$compile", () => {
|
|
|
1577
1562
|
},
|
|
1578
1563
|
});
|
|
1579
1564
|
reloadModules();
|
|
1580
|
-
|
|
1565
|
+
const el = $("<div my-directive my-other-directive></div>");
|
|
1581
1566
|
expect(() => {
|
|
1582
1567
|
$compile(el);
|
|
1583
1568
|
}).toThrowError();
|
|
1584
1569
|
});
|
|
1585
1570
|
|
|
1586
1571
|
it("adds data for element with isolated scope", function () {
|
|
1587
|
-
|
|
1572
|
+
let givenScope;
|
|
1588
1573
|
registerDirectives("myDirective", function () {
|
|
1589
1574
|
return {
|
|
1590
1575
|
scope: {},
|
|
@@ -1594,13 +1579,13 @@ describe("$compile", () => {
|
|
|
1594
1579
|
};
|
|
1595
1580
|
});
|
|
1596
1581
|
reloadModules();
|
|
1597
|
-
|
|
1582
|
+
const el = $("<div my-directive></div>");
|
|
1598
1583
|
$compile(el)($rootScope);
|
|
1599
1584
|
expect(getIsolateScope(el)).toBe(givenScope);
|
|
1600
1585
|
});
|
|
1601
1586
|
|
|
1602
1587
|
it("allows observing attribute to the isolate scope", () => {
|
|
1603
|
-
|
|
1588
|
+
let givenScope, givenAttrs;
|
|
1604
1589
|
registerDirectives("myDirective", () => {
|
|
1605
1590
|
return {
|
|
1606
1591
|
scope: {
|
|
@@ -1613,7 +1598,7 @@ describe("$compile", () => {
|
|
|
1613
1598
|
};
|
|
1614
1599
|
});
|
|
1615
1600
|
reloadModules();
|
|
1616
|
-
|
|
1601
|
+
const el = $("<div my-directive></div>");
|
|
1617
1602
|
$compile(el)($rootScope);
|
|
1618
1603
|
givenAttrs.$set("anAttr", "42");
|
|
1619
1604
|
expect(givenScope.anAttr).toEqual("42");
|
|
@@ -1623,7 +1608,7 @@ describe("$compile", () => {
|
|
|
1623
1608
|
});
|
|
1624
1609
|
|
|
1625
1610
|
it("sets initial value of observed attr to the isolate scope", () => {
|
|
1626
|
-
|
|
1611
|
+
let givenScope;
|
|
1627
1612
|
registerDirectives("myDirective", () => {
|
|
1628
1613
|
return {
|
|
1629
1614
|
scope: {
|
|
@@ -1635,13 +1620,13 @@ describe("$compile", () => {
|
|
|
1635
1620
|
};
|
|
1636
1621
|
});
|
|
1637
1622
|
reloadModules();
|
|
1638
|
-
|
|
1623
|
+
const el = $('<div my-directive an-attr="42"></div>');
|
|
1639
1624
|
$compile(el)($rootScope);
|
|
1640
1625
|
expect(givenScope.anAttr).toEqual("42");
|
|
1641
1626
|
});
|
|
1642
1627
|
|
|
1643
1628
|
it("allows aliasing observed attribute", async () => {
|
|
1644
|
-
|
|
1629
|
+
let givenScope;
|
|
1645
1630
|
registerDirectives("myDirective", () => {
|
|
1646
1631
|
return {
|
|
1647
1632
|
scope: {
|
|
@@ -1653,7 +1638,7 @@ describe("$compile", () => {
|
|
|
1653
1638
|
};
|
|
1654
1639
|
});
|
|
1655
1640
|
reloadModules();
|
|
1656
|
-
|
|
1641
|
+
const el = $('<div my-directive an-attr="42"></div>');
|
|
1657
1642
|
$compile(el)($rootScope);
|
|
1658
1643
|
await wait();
|
|
1659
1644
|
expect(givenScope.aScopeAttr).toEqual("42");
|
|
@@ -1661,7 +1646,7 @@ describe("$compile", () => {
|
|
|
1661
1646
|
|
|
1662
1647
|
describe("bi-directional databinding", () => {
|
|
1663
1648
|
it("allows binding expression to isolate scope", () => {
|
|
1664
|
-
|
|
1649
|
+
let givenScope;
|
|
1665
1650
|
registerDirectives("myDirective", () => {
|
|
1666
1651
|
return {
|
|
1667
1652
|
scope: {
|
|
@@ -1673,13 +1658,13 @@ describe("$compile", () => {
|
|
|
1673
1658
|
};
|
|
1674
1659
|
});
|
|
1675
1660
|
reloadModules();
|
|
1676
|
-
|
|
1661
|
+
const el = $('<div my-directive an-attr="42"></div>');
|
|
1677
1662
|
$compile(el)($rootScope);
|
|
1678
1663
|
expect(givenScope.anAttr).toBe(42);
|
|
1679
1664
|
});
|
|
1680
1665
|
|
|
1681
1666
|
it("allows aliasing expression attribute on isolate scope", async () => {
|
|
1682
|
-
|
|
1667
|
+
let givenScope;
|
|
1683
1668
|
registerDirectives("myDirective", () => {
|
|
1684
1669
|
return {
|
|
1685
1670
|
scope: {
|
|
@@ -1691,14 +1676,14 @@ describe("$compile", () => {
|
|
|
1691
1676
|
};
|
|
1692
1677
|
});
|
|
1693
1678
|
reloadModules();
|
|
1694
|
-
|
|
1679
|
+
const el = $('<div my-directive the-attr="42"></div>');
|
|
1695
1680
|
$compile(el)($rootScope);
|
|
1696
1681
|
await wait();
|
|
1697
1682
|
expect(givenScope.myAttr).toBe(42);
|
|
1698
1683
|
});
|
|
1699
1684
|
|
|
1700
1685
|
it("evaluates isolate scope expression on parent scope", async () => {
|
|
1701
|
-
|
|
1686
|
+
let givenScope;
|
|
1702
1687
|
registerDirectives("myDirective", () => {
|
|
1703
1688
|
return {
|
|
1704
1689
|
scope: {
|
|
@@ -1711,14 +1696,14 @@ describe("$compile", () => {
|
|
|
1711
1696
|
});
|
|
1712
1697
|
reloadModules();
|
|
1713
1698
|
$rootScope.parentAttr = 41;
|
|
1714
|
-
|
|
1699
|
+
const el = $('<div my-directive my-attr="parentAttr + 1"></div>');
|
|
1715
1700
|
$compile(el)($rootScope);
|
|
1716
1701
|
await wait();
|
|
1717
1702
|
expect(givenScope.myAttr).toBe(42);
|
|
1718
1703
|
});
|
|
1719
1704
|
|
|
1720
1705
|
it("watches isolated scope expressions", async () => {
|
|
1721
|
-
|
|
1706
|
+
let givenScope;
|
|
1722
1707
|
registerDirectives("myDirective", () => {
|
|
1723
1708
|
return {
|
|
1724
1709
|
scope: {
|
|
@@ -1731,7 +1716,7 @@ describe("$compile", () => {
|
|
|
1731
1716
|
});
|
|
1732
1717
|
reloadModules();
|
|
1733
1718
|
|
|
1734
|
-
|
|
1719
|
+
const el = $('<div my-directive my-attr="parentAttr + 1"></div>');
|
|
1735
1720
|
$compile(el)($rootScope);
|
|
1736
1721
|
await wait();
|
|
1737
1722
|
$rootScope.parentAttr = 41;
|
|
@@ -1749,14 +1734,14 @@ describe("$compile", () => {
|
|
|
1749
1734
|
};
|
|
1750
1735
|
});
|
|
1751
1736
|
reloadModules();
|
|
1752
|
-
|
|
1737
|
+
const el = $("<div my-directive></div>");
|
|
1753
1738
|
$compile(el)($rootScope);
|
|
1754
1739
|
await wait();
|
|
1755
1740
|
expect($rootScope.$handler.watchers.size).toEqual(1);
|
|
1756
1741
|
});
|
|
1757
1742
|
|
|
1758
1743
|
it("allows assigning to two-way scope expressions", async () => {
|
|
1759
|
-
|
|
1744
|
+
let isolateScope;
|
|
1760
1745
|
registerDirectives("myDirective", () => {
|
|
1761
1746
|
return {
|
|
1762
1747
|
scope: {
|
|
@@ -1768,7 +1753,7 @@ describe("$compile", () => {
|
|
|
1768
1753
|
};
|
|
1769
1754
|
});
|
|
1770
1755
|
reloadModules();
|
|
1771
|
-
|
|
1756
|
+
const el = $('<div my-directive my-attr="parentAttr"></div>');
|
|
1772
1757
|
$compile(el)($rootScope);
|
|
1773
1758
|
await wait();
|
|
1774
1759
|
isolateScope.myAttr = 42;
|
|
@@ -1778,7 +1763,7 @@ describe("$compile", () => {
|
|
|
1778
1763
|
});
|
|
1779
1764
|
|
|
1780
1765
|
it("gives parent change precedence when both parent and child change", async () => {
|
|
1781
|
-
|
|
1766
|
+
let isolateScope;
|
|
1782
1767
|
registerDirectives("myDirective", () => {
|
|
1783
1768
|
return {
|
|
1784
1769
|
scope: {
|
|
@@ -1790,7 +1775,7 @@ describe("$compile", () => {
|
|
|
1790
1775
|
};
|
|
1791
1776
|
});
|
|
1792
1777
|
reloadModules();
|
|
1793
|
-
|
|
1778
|
+
const el = $('<div my-directive my-attr="parentAttr"></div>');
|
|
1794
1779
|
$compile(el)($rootScope);
|
|
1795
1780
|
$rootScope.parentAttr = 42;
|
|
1796
1781
|
isolateScope.myAttr = 43;
|
|
@@ -1800,7 +1785,7 @@ describe("$compile", () => {
|
|
|
1800
1785
|
});
|
|
1801
1786
|
|
|
1802
1787
|
it("does not throw when two-way expression returns new arrays", async () => {
|
|
1803
|
-
|
|
1788
|
+
let givenScope;
|
|
1804
1789
|
registerDirectives("myDirective", () => {
|
|
1805
1790
|
return {
|
|
1806
1791
|
scope: {
|
|
@@ -1815,14 +1800,14 @@ describe("$compile", () => {
|
|
|
1815
1800
|
$rootScope.parentFunction = () => {
|
|
1816
1801
|
return [1, 2, 3];
|
|
1817
1802
|
};
|
|
1818
|
-
|
|
1803
|
+
const el = $('<div my-directive my-attr="parentFunction()"></div>');
|
|
1819
1804
|
$compile(el)($rootScope);
|
|
1820
1805
|
await wait();
|
|
1821
1806
|
expect(givenScope.myAttr).toEqual([1, 2, 3]);
|
|
1822
1807
|
});
|
|
1823
1808
|
|
|
1824
1809
|
it("can watch two-way bindings as collections", async () => {
|
|
1825
|
-
|
|
1810
|
+
let givenScope;
|
|
1826
1811
|
registerDirectives("myDirective", () => {
|
|
1827
1812
|
return {
|
|
1828
1813
|
scope: {
|
|
@@ -1837,7 +1822,7 @@ describe("$compile", () => {
|
|
|
1837
1822
|
$rootScope.parentFunction = () => {
|
|
1838
1823
|
return [1, 2, 3];
|
|
1839
1824
|
};
|
|
1840
|
-
|
|
1825
|
+
const el = $('<div my-directive my-attr="parentFunction()"></div>');
|
|
1841
1826
|
$compile(el)($rootScope);
|
|
1842
1827
|
await wait();
|
|
1843
1828
|
expect(givenScope.myAttr.$target).toEqual([1, 2, 3]);
|
|
@@ -1846,7 +1831,7 @@ describe("$compile", () => {
|
|
|
1846
1831
|
|
|
1847
1832
|
describe("one-way databinding", () => {
|
|
1848
1833
|
it("allows binding expression to isolate scope", async () => {
|
|
1849
|
-
|
|
1834
|
+
let givenScope;
|
|
1850
1835
|
registerDirectives("myDirective", () => {
|
|
1851
1836
|
return {
|
|
1852
1837
|
scope: {
|
|
@@ -1858,14 +1843,14 @@ describe("$compile", () => {
|
|
|
1858
1843
|
};
|
|
1859
1844
|
});
|
|
1860
1845
|
reloadModules();
|
|
1861
|
-
|
|
1846
|
+
const el = $('<div my-directive an-attr="42"></div>');
|
|
1862
1847
|
$compile(el)($rootScope);
|
|
1863
1848
|
await wait();
|
|
1864
1849
|
expect(givenScope.anAttr).toBe(42);
|
|
1865
1850
|
});
|
|
1866
1851
|
|
|
1867
1852
|
it("allows aliasing expression attribute on isolate scope", async () => {
|
|
1868
|
-
|
|
1853
|
+
let givenScope;
|
|
1869
1854
|
registerDirectives("myDirective", () => {
|
|
1870
1855
|
return {
|
|
1871
1856
|
scope: {
|
|
@@ -1877,14 +1862,14 @@ describe("$compile", () => {
|
|
|
1877
1862
|
};
|
|
1878
1863
|
});
|
|
1879
1864
|
reloadModules();
|
|
1880
|
-
|
|
1865
|
+
const el = $('<div my-directive the-attr="42"></div>');
|
|
1881
1866
|
$compile(el)($rootScope);
|
|
1882
1867
|
await wait();
|
|
1883
1868
|
expect(givenScope.myAttr).toBe(42);
|
|
1884
1869
|
});
|
|
1885
1870
|
|
|
1886
1871
|
it("evaluates isolate scope expression on parent scope", async () => {
|
|
1887
|
-
|
|
1872
|
+
let givenScope;
|
|
1888
1873
|
registerDirectives("myDirective", () => {
|
|
1889
1874
|
return {
|
|
1890
1875
|
scope: {
|
|
@@ -1897,14 +1882,14 @@ describe("$compile", () => {
|
|
|
1897
1882
|
});
|
|
1898
1883
|
reloadModules();
|
|
1899
1884
|
$rootScope.parentAttr = 41;
|
|
1900
|
-
|
|
1885
|
+
const el = $('<div my-directive my-attr="parentAttr + 1"></div>');
|
|
1901
1886
|
$compile(el)($rootScope);
|
|
1902
1887
|
await wait();
|
|
1903
1888
|
expect(givenScope.myAttr).toBe(42);
|
|
1904
1889
|
});
|
|
1905
1890
|
|
|
1906
1891
|
it("watches isolated scope expressions", async () => {
|
|
1907
|
-
|
|
1892
|
+
let givenScope;
|
|
1908
1893
|
registerDirectives("myDirective", () => {
|
|
1909
1894
|
return {
|
|
1910
1895
|
scope: {
|
|
@@ -1917,7 +1902,7 @@ describe("$compile", () => {
|
|
|
1917
1902
|
});
|
|
1918
1903
|
reloadModules();
|
|
1919
1904
|
|
|
1920
|
-
|
|
1905
|
+
const el = $('<div my-directive my-attr="parentAttr + 1"></div>');
|
|
1921
1906
|
$compile(el)($rootScope);
|
|
1922
1907
|
await wait();
|
|
1923
1908
|
$rootScope.parentAttr = 41;
|
|
@@ -1926,7 +1911,7 @@ describe("$compile", () => {
|
|
|
1926
1911
|
});
|
|
1927
1912
|
|
|
1928
1913
|
it("does not watch optional missing isolate scope expressions", async () => {
|
|
1929
|
-
|
|
1914
|
+
let givenScope;
|
|
1930
1915
|
registerDirectives("myDirective", () => {
|
|
1931
1916
|
return {
|
|
1932
1917
|
scope: {
|
|
@@ -1938,7 +1923,7 @@ describe("$compile", () => {
|
|
|
1938
1923
|
};
|
|
1939
1924
|
});
|
|
1940
1925
|
reloadModules();
|
|
1941
|
-
|
|
1926
|
+
const el = $("<div my-directive></div>");
|
|
1942
1927
|
$compile(el)($rootScope);
|
|
1943
1928
|
await wait();
|
|
1944
1929
|
expect($rootScope.$handler.watchers.size).toEqual(1);
|
|
@@ -1946,7 +1931,7 @@ describe("$compile", () => {
|
|
|
1946
1931
|
});
|
|
1947
1932
|
|
|
1948
1933
|
it("allows binding an invokable expression on the parent scope", () => {
|
|
1949
|
-
|
|
1934
|
+
let givenScope;
|
|
1950
1935
|
registerDirectives("myDirective", () => {
|
|
1951
1936
|
return {
|
|
1952
1937
|
scope: {
|
|
@@ -1961,13 +1946,13 @@ describe("$compile", () => {
|
|
|
1961
1946
|
$rootScope.parentFunction = () => {
|
|
1962
1947
|
return 42;
|
|
1963
1948
|
};
|
|
1964
|
-
|
|
1949
|
+
const el = $('<div my-directive my-expr="parentFunction() + 1"></div>');
|
|
1965
1950
|
$compile(el)($rootScope);
|
|
1966
1951
|
expect(givenScope.myExpr()).toBe(43);
|
|
1967
1952
|
});
|
|
1968
1953
|
|
|
1969
1954
|
it("allows passing arguments to parent scope expression", () => {
|
|
1970
|
-
|
|
1955
|
+
let givenScope;
|
|
1971
1956
|
registerDirectives("myDirective", () => {
|
|
1972
1957
|
return {
|
|
1973
1958
|
scope: {
|
|
@@ -1979,11 +1964,11 @@ describe("$compile", () => {
|
|
|
1979
1964
|
};
|
|
1980
1965
|
});
|
|
1981
1966
|
reloadModules();
|
|
1982
|
-
|
|
1967
|
+
let gotArg;
|
|
1983
1968
|
$rootScope.parentFunction = function (arg) {
|
|
1984
1969
|
gotArg = arg;
|
|
1985
1970
|
};
|
|
1986
|
-
|
|
1971
|
+
const el = $(
|
|
1987
1972
|
'<div my-directive my-expr="parentFunction(argFromChild)"></div>',
|
|
1988
1973
|
);
|
|
1989
1974
|
$compile(el)($rootScope);
|
|
@@ -1992,7 +1977,7 @@ describe("$compile", () => {
|
|
|
1992
1977
|
});
|
|
1993
1978
|
|
|
1994
1979
|
it("sets missing optional parent scope expression to undefined", () => {
|
|
1995
|
-
|
|
1980
|
+
let givenScope;
|
|
1996
1981
|
registerDirectives("myDirective", () => {
|
|
1997
1982
|
return {
|
|
1998
1983
|
scope: {
|
|
@@ -2004,18 +1989,18 @@ describe("$compile", () => {
|
|
|
2004
1989
|
};
|
|
2005
1990
|
});
|
|
2006
1991
|
reloadModules();
|
|
2007
|
-
|
|
1992
|
+
let gotArg;
|
|
2008
1993
|
$rootScope.parentFunction = function (arg) {
|
|
2009
1994
|
gotArg = arg;
|
|
2010
1995
|
};
|
|
2011
|
-
|
|
1996
|
+
const el = $("<div my-directive></div>");
|
|
2012
1997
|
$compile(el)($rootScope);
|
|
2013
1998
|
expect(givenScope.myExpr).toBeUndefined();
|
|
2014
1999
|
});
|
|
2015
2000
|
|
|
2016
2001
|
describe("controllers", () => {
|
|
2017
2002
|
it("can be attached to directives as functions", async () => {
|
|
2018
|
-
|
|
2003
|
+
let controllerInvoked;
|
|
2019
2004
|
registerDirectives("myDirective", () => {
|
|
2020
2005
|
return {
|
|
2021
2006
|
controller: function MyController() {
|
|
@@ -2024,14 +2009,15 @@ describe("$compile", () => {
|
|
|
2024
2009
|
};
|
|
2025
2010
|
});
|
|
2026
2011
|
reloadModules();
|
|
2027
|
-
|
|
2012
|
+
const el = $("<div my-directive></div>");
|
|
2028
2013
|
$compile(el)($rootScope);
|
|
2029
2014
|
await wait();
|
|
2030
2015
|
expect(controllerInvoked).toBe(true);
|
|
2031
2016
|
});
|
|
2032
2017
|
|
|
2033
2018
|
it("can be attached to directives as string references", async () => {
|
|
2034
|
-
|
|
2019
|
+
let controllerInvoked;
|
|
2020
|
+
|
|
2035
2021
|
function MyController() {
|
|
2036
2022
|
controllerInvoked = true;
|
|
2037
2023
|
}
|
|
@@ -2042,15 +2028,16 @@ describe("$compile", () => {
|
|
|
2042
2028
|
});
|
|
2043
2029
|
|
|
2044
2030
|
reloadModules();
|
|
2045
|
-
|
|
2031
|
+
const el = $("<div my-directive></div>");
|
|
2046
2032
|
$compile(el)($rootScope);
|
|
2047
2033
|
await wait();
|
|
2048
2034
|
expect(controllerInvoked).toBe(true);
|
|
2049
2035
|
});
|
|
2050
2036
|
|
|
2051
2037
|
it("can be applied in the same element independent of each other", () => {
|
|
2052
|
-
|
|
2053
|
-
|
|
2038
|
+
let controllerInvoked;
|
|
2039
|
+
let otherControllerInvoked;
|
|
2040
|
+
|
|
2054
2041
|
function MyController() {
|
|
2055
2042
|
controllerInvoked = true;
|
|
2056
2043
|
}
|
|
@@ -2067,14 +2054,15 @@ describe("$compile", () => {
|
|
|
2067
2054
|
return { controller: "MyOtherController" };
|
|
2068
2055
|
});
|
|
2069
2056
|
reloadModules();
|
|
2070
|
-
|
|
2057
|
+
const el = $("<div my-directive my-other-directive></div>");
|
|
2071
2058
|
$compile(el)($rootScope);
|
|
2072
2059
|
expect(controllerInvoked).toBe(true);
|
|
2073
2060
|
expect(otherControllerInvoked).toBe(true);
|
|
2074
2061
|
});
|
|
2075
2062
|
|
|
2076
2063
|
it("can be applied to different directives, as different instances", () => {
|
|
2077
|
-
|
|
2064
|
+
let invocations = 0;
|
|
2065
|
+
|
|
2078
2066
|
function MyController() {
|
|
2079
2067
|
invocations++;
|
|
2080
2068
|
}
|
|
@@ -2087,13 +2075,14 @@ describe("$compile", () => {
|
|
|
2087
2075
|
return { controller: "MyController" };
|
|
2088
2076
|
});
|
|
2089
2077
|
reloadModules();
|
|
2090
|
-
|
|
2078
|
+
const el = $("<div my-directive my-other-directive></div>");
|
|
2091
2079
|
$compile(el)($rootScope);
|
|
2092
2080
|
expect(invocations).toBe(2);
|
|
2093
2081
|
});
|
|
2094
2082
|
|
|
2095
2083
|
it("can be aliased with @ when given in directive attribute", () => {
|
|
2096
|
-
|
|
2084
|
+
let controllerInvoked;
|
|
2085
|
+
|
|
2097
2086
|
function MyController() {
|
|
2098
2087
|
controllerInvoked = true;
|
|
2099
2088
|
}
|
|
@@ -2109,7 +2098,8 @@ describe("$compile", () => {
|
|
|
2109
2098
|
});
|
|
2110
2099
|
|
|
2111
2100
|
it("gets scope, element, and attrs through DI", () => {
|
|
2112
|
-
|
|
2101
|
+
let gotScope, gotElement, gotAttrs;
|
|
2102
|
+
|
|
2113
2103
|
function MyController($element, $scope, $attrs) {
|
|
2114
2104
|
gotElement = $element;
|
|
2115
2105
|
gotScope = $scope;
|
|
@@ -2121,7 +2111,7 @@ describe("$compile", () => {
|
|
|
2121
2111
|
return { controller: "MyController" };
|
|
2122
2112
|
});
|
|
2123
2113
|
reloadModules();
|
|
2124
|
-
|
|
2114
|
+
const el = $('<div my-directive an-attr="abc"></div>');
|
|
2125
2115
|
$compile(el)($rootScope);
|
|
2126
2116
|
expect(gotElement[0]).toBe(el[0]);
|
|
2127
2117
|
expect(gotScope).toBe($rootScope);
|
|
@@ -2140,14 +2130,15 @@ describe("$compile", () => {
|
|
|
2140
2130
|
};
|
|
2141
2131
|
});
|
|
2142
2132
|
reloadModules();
|
|
2143
|
-
|
|
2133
|
+
const el = $("<div my-directive></div>");
|
|
2144
2134
|
$compile(el)($rootScope);
|
|
2145
2135
|
expect($rootScope.myCtrl).toBeDefined();
|
|
2146
2136
|
expect($rootScope.myCtrl instanceof MyController).toBe(true);
|
|
2147
2137
|
});
|
|
2148
2138
|
|
|
2149
2139
|
it("gets isolate scope as injected $scope", () => {
|
|
2150
|
-
|
|
2140
|
+
let gotScope;
|
|
2141
|
+
|
|
2151
2142
|
function MyController($scope) {
|
|
2152
2143
|
gotScope = $scope;
|
|
2153
2144
|
}
|
|
@@ -2160,13 +2151,14 @@ describe("$compile", () => {
|
|
|
2160
2151
|
};
|
|
2161
2152
|
});
|
|
2162
2153
|
reloadModules();
|
|
2163
|
-
|
|
2154
|
+
const el = $("<div my-directive></div>");
|
|
2164
2155
|
$compile(el)($rootScope);
|
|
2165
2156
|
expect(gotScope).not.toBe($rootScope);
|
|
2166
2157
|
});
|
|
2167
2158
|
|
|
2168
2159
|
it("has isolate scope bindings available during construction", () => {
|
|
2169
|
-
|
|
2160
|
+
let gotMyAttr;
|
|
2161
|
+
|
|
2170
2162
|
function MyController($scope) {
|
|
2171
2163
|
gotMyAttr = $scope.myAttr;
|
|
2172
2164
|
}
|
|
@@ -2181,13 +2173,14 @@ describe("$compile", () => {
|
|
|
2181
2173
|
};
|
|
2182
2174
|
});
|
|
2183
2175
|
reloadModules();
|
|
2184
|
-
|
|
2176
|
+
const el = $('<div my-directive="abc"></div>');
|
|
2185
2177
|
$compile(el)($rootScope);
|
|
2186
2178
|
expect(gotMyAttr).toEqual("abc");
|
|
2187
2179
|
});
|
|
2188
2180
|
|
|
2189
2181
|
it("can bind isolate scope bindings directly to self", () => {
|
|
2190
|
-
|
|
2182
|
+
let ctl;
|
|
2183
|
+
|
|
2191
2184
|
function MyController() {
|
|
2192
2185
|
ctl = this;
|
|
2193
2186
|
}
|
|
@@ -2203,7 +2196,7 @@ describe("$compile", () => {
|
|
|
2203
2196
|
};
|
|
2204
2197
|
});
|
|
2205
2198
|
reloadModules();
|
|
2206
|
-
|
|
2199
|
+
const el = $('<div my-directive="abc"></div>');
|
|
2207
2200
|
|
|
2208
2201
|
$compile(el)($rootScope);
|
|
2209
2202
|
expect(ctl.myAttr).toEqual("abc");
|
|
@@ -2212,22 +2205,23 @@ describe("$compile", () => {
|
|
|
2212
2205
|
it("can return a semi-constructed controller when using array injection", () => {
|
|
2213
2206
|
myModule.constant("aDep", 42);
|
|
2214
2207
|
reloadModules();
|
|
2215
|
-
|
|
2208
|
+
const $controller = injector.get("$controller");
|
|
2216
2209
|
|
|
2217
2210
|
function MyController(aDep) {
|
|
2218
2211
|
this.aDep = aDep;
|
|
2219
2212
|
this.constructed = true;
|
|
2220
2213
|
}
|
|
2221
2214
|
|
|
2222
|
-
|
|
2215
|
+
const controller = $controller(["aDep", MyController], null, true);
|
|
2223
2216
|
expect(controller.constructed).toBeUndefined();
|
|
2224
|
-
|
|
2217
|
+
const actualController = controller();
|
|
2225
2218
|
expect(actualController.constructed).toBeDefined();
|
|
2226
2219
|
expect(actualController.aDep).toBe(42);
|
|
2227
2220
|
});
|
|
2228
2221
|
|
|
2229
2222
|
it("can bind iso scope bindings through bindToController", () => {
|
|
2230
|
-
|
|
2223
|
+
let ctl;
|
|
2224
|
+
|
|
2231
2225
|
function MyController() {
|
|
2232
2226
|
ctl = this;
|
|
2233
2227
|
}
|
|
@@ -2243,13 +2237,14 @@ describe("$compile", () => {
|
|
|
2243
2237
|
};
|
|
2244
2238
|
});
|
|
2245
2239
|
reloadModules();
|
|
2246
|
-
|
|
2240
|
+
const el = $('<div my-directive="abc"></div>');
|
|
2247
2241
|
$compile(el)($rootScope);
|
|
2248
2242
|
expect(ctl.myAttr).toEqual("abc");
|
|
2249
2243
|
});
|
|
2250
2244
|
|
|
2251
2245
|
it("can bind through bindToController without iso scope", () => {
|
|
2252
|
-
|
|
2246
|
+
let ctl;
|
|
2247
|
+
|
|
2253
2248
|
function MyController() {
|
|
2254
2249
|
ctl = this;
|
|
2255
2250
|
}
|
|
@@ -2265,14 +2260,15 @@ describe("$compile", () => {
|
|
|
2265
2260
|
};
|
|
2266
2261
|
});
|
|
2267
2262
|
reloadModules();
|
|
2268
|
-
|
|
2263
|
+
const el = $('<div my-directive="abc"></div>');
|
|
2269
2264
|
$compile(el)($rootScope);
|
|
2270
2265
|
expect(ctl.myAttr).toEqual("abc");
|
|
2271
2266
|
});
|
|
2272
2267
|
|
|
2273
2268
|
it("can be required from a sibling directive", () => {
|
|
2274
2269
|
function MyController() {}
|
|
2275
|
-
|
|
2270
|
+
|
|
2271
|
+
let gotMyController;
|
|
2276
2272
|
myModule
|
|
2277
2273
|
.directive("myDirective", () => {
|
|
2278
2274
|
return {
|
|
@@ -2289,7 +2285,7 @@ describe("$compile", () => {
|
|
|
2289
2285
|
};
|
|
2290
2286
|
});
|
|
2291
2287
|
reloadModules();
|
|
2292
|
-
|
|
2288
|
+
const el = $("<div my-directive my-other-directive></div>");
|
|
2293
2289
|
$compile(el)($rootScope);
|
|
2294
2290
|
expect(gotMyController).toBeDefined();
|
|
2295
2291
|
expect(gotMyController instanceof MyController).toBe(true);
|
|
@@ -2298,7 +2294,8 @@ describe("$compile", () => {
|
|
|
2298
2294
|
it("can be required from multiple sibling directives", () => {
|
|
2299
2295
|
function MyController() {}
|
|
2300
2296
|
function MyOtherController() {}
|
|
2301
|
-
|
|
2297
|
+
|
|
2298
|
+
let gotControllers;
|
|
2302
2299
|
myModule
|
|
2303
2300
|
.directive("myDirective", () => {
|
|
2304
2301
|
return {
|
|
@@ -2321,7 +2318,7 @@ describe("$compile", () => {
|
|
|
2321
2318
|
};
|
|
2322
2319
|
});
|
|
2323
2320
|
reloadModules();
|
|
2324
|
-
|
|
2321
|
+
const el = $(
|
|
2325
2322
|
"<div my-directive my-other-directive my-third-directive></div>",
|
|
2326
2323
|
);
|
|
2327
2324
|
$compile(el)($rootScope);
|
|
@@ -2334,7 +2331,8 @@ describe("$compile", () => {
|
|
|
2334
2331
|
it("can be required as an object", () => {
|
|
2335
2332
|
function MyController() {}
|
|
2336
2333
|
function MyOtherController() {}
|
|
2337
|
-
|
|
2334
|
+
|
|
2335
|
+
let gotControllers;
|
|
2338
2336
|
myModule
|
|
2339
2337
|
.directive("myDirective", () => {
|
|
2340
2338
|
return {
|
|
@@ -2360,7 +2358,7 @@ describe("$compile", () => {
|
|
|
2360
2358
|
};
|
|
2361
2359
|
});
|
|
2362
2360
|
reloadModules();
|
|
2363
|
-
|
|
2361
|
+
const el = $(
|
|
2364
2362
|
"<div my-directive my-other-directive my-third-directive></div>",
|
|
2365
2363
|
);
|
|
2366
2364
|
$compile(el)($rootScope);
|
|
@@ -2373,7 +2371,8 @@ describe("$compile", () => {
|
|
|
2373
2371
|
|
|
2374
2372
|
it("can be required as an object with values omitted", () => {
|
|
2375
2373
|
function MyController() {}
|
|
2376
|
-
|
|
2374
|
+
|
|
2375
|
+
let gotControllers;
|
|
2377
2376
|
myModule
|
|
2378
2377
|
.directive("myDirective", () => {
|
|
2379
2378
|
return {
|
|
@@ -2392,7 +2391,7 @@ describe("$compile", () => {
|
|
|
2392
2391
|
};
|
|
2393
2392
|
});
|
|
2394
2393
|
reloadModules();
|
|
2395
|
-
|
|
2394
|
+
const el = $(
|
|
2396
2395
|
"<div my-directive my-other-directive my-third-directive></div>",
|
|
2397
2396
|
);
|
|
2398
2397
|
$compile(el)($rootScope);
|
|
@@ -2402,7 +2401,8 @@ describe("$compile", () => {
|
|
|
2402
2401
|
|
|
2403
2402
|
it("requires itself if there is no explicit require", () => {
|
|
2404
2403
|
function MyController() {}
|
|
2405
|
-
|
|
2404
|
+
|
|
2405
|
+
let gotMyController;
|
|
2406
2406
|
myModule.directive("myDirective", () => {
|
|
2407
2407
|
return {
|
|
2408
2408
|
scope: {},
|
|
@@ -2413,7 +2413,7 @@ describe("$compile", () => {
|
|
|
2413
2413
|
};
|
|
2414
2414
|
});
|
|
2415
2415
|
reloadModules();
|
|
2416
|
-
|
|
2416
|
+
const el = $("<div my-directive></div>");
|
|
2417
2417
|
$compile(el)($rootScope);
|
|
2418
2418
|
expect(gotMyController).toBeDefined();
|
|
2419
2419
|
expect(gotMyController instanceof MyController).toBe(true);
|
|
@@ -2421,7 +2421,8 @@ describe("$compile", () => {
|
|
|
2421
2421
|
|
|
2422
2422
|
it("can be required from a parent directive", async () => {
|
|
2423
2423
|
function MyController() {}
|
|
2424
|
-
|
|
2424
|
+
|
|
2425
|
+
let gotMyController;
|
|
2425
2426
|
myModule
|
|
2426
2427
|
.directive("myDirective", () => {
|
|
2427
2428
|
return {
|
|
@@ -2438,7 +2439,7 @@ describe("$compile", () => {
|
|
|
2438
2439
|
};
|
|
2439
2440
|
});
|
|
2440
2441
|
reloadModules();
|
|
2441
|
-
|
|
2442
|
+
const el = $("<div my-directive><div my-other-directive></div></div>");
|
|
2442
2443
|
$compile(el)($rootScope);
|
|
2443
2444
|
await wait();
|
|
2444
2445
|
expect(gotMyController).toBeDefined();
|
|
@@ -2447,7 +2448,8 @@ describe("$compile", () => {
|
|
|
2447
2448
|
|
|
2448
2449
|
it("also finds from sibling directive when requiring with parent prefix", () => {
|
|
2449
2450
|
function MyController() {}
|
|
2450
|
-
|
|
2451
|
+
|
|
2452
|
+
let gotMyController;
|
|
2451
2453
|
myModule
|
|
2452
2454
|
.directive("myDirective", () => {
|
|
2453
2455
|
return {
|
|
@@ -2464,7 +2466,7 @@ describe("$compile", () => {
|
|
|
2464
2466
|
};
|
|
2465
2467
|
});
|
|
2466
2468
|
reloadModules();
|
|
2467
|
-
|
|
2469
|
+
const el = $("<div my-directive my-other-directive></div>");
|
|
2468
2470
|
$compile(el)($rootScope);
|
|
2469
2471
|
expect(gotMyController).toBeDefined();
|
|
2470
2472
|
expect(gotMyController instanceof MyController).toBe(true);
|
|
@@ -2472,7 +2474,8 @@ describe("$compile", () => {
|
|
|
2472
2474
|
|
|
2473
2475
|
it("can be required from a parent directive with ^^", () => {
|
|
2474
2476
|
function MyController() {}
|
|
2475
|
-
|
|
2477
|
+
|
|
2478
|
+
let gotMyController;
|
|
2476
2479
|
myModule
|
|
2477
2480
|
.directive("myDirective", () => {
|
|
2478
2481
|
return {
|
|
@@ -2489,7 +2492,7 @@ describe("$compile", () => {
|
|
|
2489
2492
|
};
|
|
2490
2493
|
});
|
|
2491
2494
|
reloadModules();
|
|
2492
|
-
|
|
2495
|
+
const el = $("<div my-directive><div my-other-directive></div></div>");
|
|
2493
2496
|
$compile(el)($rootScope);
|
|
2494
2497
|
expect(gotMyController).toBeDefined();
|
|
2495
2498
|
expect(gotMyController instanceof MyController).toBe(true);
|
|
@@ -2511,7 +2514,7 @@ describe("$compile", () => {
|
|
|
2511
2514
|
};
|
|
2512
2515
|
});
|
|
2513
2516
|
reloadModules();
|
|
2514
|
-
|
|
2517
|
+
const el = $("<div my-directive my-other-directive></div>");
|
|
2515
2518
|
expect(() => {
|
|
2516
2519
|
$compile(el)($rootScope);
|
|
2517
2520
|
}).toThrowError();
|
|
@@ -2519,7 +2522,8 @@ describe("$compile", () => {
|
|
|
2519
2522
|
|
|
2520
2523
|
it("can be required from parent in object form", () => {
|
|
2521
2524
|
function MyController() {}
|
|
2522
|
-
|
|
2525
|
+
|
|
2526
|
+
let gotControllers;
|
|
2523
2527
|
myModule
|
|
2524
2528
|
.directive("myDirective", () => {
|
|
2525
2529
|
return {
|
|
@@ -2538,13 +2542,13 @@ describe("$compile", () => {
|
|
|
2538
2542
|
};
|
|
2539
2543
|
});
|
|
2540
2544
|
reloadModules();
|
|
2541
|
-
|
|
2545
|
+
const el = $("<div my-directive><div my-other-directive></div></div>");
|
|
2542
2546
|
$compile(el)($rootScope);
|
|
2543
2547
|
expect(gotControllers.myDirective instanceof MyController).toBe(true);
|
|
2544
2548
|
});
|
|
2545
2549
|
|
|
2546
2550
|
it("does not throw on required missing controller when optional", () => {
|
|
2547
|
-
|
|
2551
|
+
let gotCtrl;
|
|
2548
2552
|
myModule.directive("myDirective", () => {
|
|
2549
2553
|
return {
|
|
2550
2554
|
require: "?noSuchDirective",
|
|
@@ -2554,13 +2558,13 @@ describe("$compile", () => {
|
|
|
2554
2558
|
};
|
|
2555
2559
|
});
|
|
2556
2560
|
reloadModules();
|
|
2557
|
-
|
|
2561
|
+
const el = $("<div my-directive></div>");
|
|
2558
2562
|
$compile(el)($rootScope);
|
|
2559
2563
|
expect(gotCtrl).toBe(null);
|
|
2560
2564
|
});
|
|
2561
2565
|
|
|
2562
2566
|
it("allows optional marker after parent marker", () => {
|
|
2563
|
-
|
|
2567
|
+
let gotCtrl;
|
|
2564
2568
|
myModule.directive("myDirective", () => {
|
|
2565
2569
|
return {
|
|
2566
2570
|
require: "^?noSuchDirective",
|
|
@@ -2570,14 +2574,15 @@ describe("$compile", () => {
|
|
|
2570
2574
|
};
|
|
2571
2575
|
});
|
|
2572
2576
|
reloadModules();
|
|
2573
|
-
|
|
2577
|
+
const el = $("<div my-directive></div>");
|
|
2574
2578
|
$compile(el)($rootScope);
|
|
2575
2579
|
expect(gotCtrl).toBe(null);
|
|
2576
2580
|
});
|
|
2577
2581
|
|
|
2578
2582
|
it("allows optional marker before parent marker", () => {
|
|
2579
2583
|
function MyController() {}
|
|
2580
|
-
|
|
2584
|
+
|
|
2585
|
+
let gotMyController;
|
|
2581
2586
|
myModule
|
|
2582
2587
|
.directive("myDirective", () => {
|
|
2583
2588
|
return {
|
|
@@ -2594,7 +2599,7 @@ describe("$compile", () => {
|
|
|
2594
2599
|
};
|
|
2595
2600
|
});
|
|
2596
2601
|
reloadModules();
|
|
2597
|
-
|
|
2602
|
+
const el = $("<div my-directive my-other-directive></div>");
|
|
2598
2603
|
$compile(el)($rootScope);
|
|
2599
2604
|
expect(gotMyController).toBeDefined();
|
|
2600
2605
|
expect(gotMyController instanceof MyController).toBe(true);
|
|
@@ -2602,7 +2607,8 @@ describe("$compile", () => {
|
|
|
2602
2607
|
|
|
2603
2608
|
it("attaches required controllers on controller when using object", () => {
|
|
2604
2609
|
function MyController() {}
|
|
2605
|
-
|
|
2610
|
+
|
|
2611
|
+
let ctl;
|
|
2606
2612
|
myModule
|
|
2607
2613
|
.directive("myDirective", () => {
|
|
2608
2614
|
return {
|
|
@@ -2638,7 +2644,7 @@ describe("$compile", () => {
|
|
|
2638
2644
|
};
|
|
2639
2645
|
});
|
|
2640
2646
|
reloadModules();
|
|
2641
|
-
|
|
2647
|
+
const el = $("<div my-directive></div>");
|
|
2642
2648
|
$compile(el);
|
|
2643
2649
|
expect(el.innerHTML).toBe('<div class="from-template"></div>');
|
|
2644
2650
|
});
|
|
@@ -2650,13 +2656,13 @@ describe("$compile", () => {
|
|
|
2650
2656
|
};
|
|
2651
2657
|
});
|
|
2652
2658
|
reloadModules();
|
|
2653
|
-
|
|
2659
|
+
const el = $('<div my-directive><div class="existing"></div></div>');
|
|
2654
2660
|
$compile(el);
|
|
2655
2661
|
expect(el.innerHTML).toBe('<div class="from-template"></div>');
|
|
2656
2662
|
});
|
|
2657
2663
|
|
|
2658
2664
|
it("compiles template contents also", () => {
|
|
2659
|
-
|
|
2665
|
+
const compileSpy = jasmine.createSpy();
|
|
2660
2666
|
registerDirectives({
|
|
2661
2667
|
myDirective: () => {
|
|
2662
2668
|
return {
|
|
@@ -2670,7 +2676,7 @@ describe("$compile", () => {
|
|
|
2670
2676
|
},
|
|
2671
2677
|
});
|
|
2672
2678
|
reloadModules();
|
|
2673
|
-
|
|
2679
|
+
const el = $("<div my-directive></div>");
|
|
2674
2680
|
$compile(el);
|
|
2675
2681
|
expect(compileSpy).toHaveBeenCalled();
|
|
2676
2682
|
});
|
|
@@ -2685,14 +2691,14 @@ describe("$compile", () => {
|
|
|
2685
2691
|
},
|
|
2686
2692
|
});
|
|
2687
2693
|
reloadModules();
|
|
2688
|
-
|
|
2694
|
+
const el = $("<div my-directive my-other-directive></div>");
|
|
2689
2695
|
expect(() => {
|
|
2690
2696
|
$compile(el);
|
|
2691
2697
|
}).toThrowError();
|
|
2692
2698
|
});
|
|
2693
2699
|
|
|
2694
2700
|
it("supports functions as template values", () => {
|
|
2695
|
-
|
|
2701
|
+
const templateSpy = jasmine
|
|
2696
2702
|
.createSpy()
|
|
2697
2703
|
.and.returnValue('<div class="from-template"></div>');
|
|
2698
2704
|
registerDirectives({
|
|
@@ -2703,7 +2709,7 @@ describe("$compile", () => {
|
|
|
2703
2709
|
},
|
|
2704
2710
|
});
|
|
2705
2711
|
reloadModules();
|
|
2706
|
-
|
|
2712
|
+
const el = $("<div my-directive></div>");
|
|
2707
2713
|
$compile(el);
|
|
2708
2714
|
expect(el.innerHTML).toBe('<div class="from-template"></div>');
|
|
2709
2715
|
expect(templateSpy.calls.first().args[0][0]).toBe(el[0]);
|
|
@@ -2711,7 +2717,7 @@ describe("$compile", () => {
|
|
|
2711
2717
|
});
|
|
2712
2718
|
|
|
2713
2719
|
it("uses isolate scope for template contents", async () => {
|
|
2714
|
-
|
|
2720
|
+
const linkSpy = jasmine.createSpy();
|
|
2715
2721
|
registerDirectives({
|
|
2716
2722
|
myDirective: () => {
|
|
2717
2723
|
return {
|
|
@@ -2726,7 +2732,7 @@ describe("$compile", () => {
|
|
|
2726
2732
|
},
|
|
2727
2733
|
});
|
|
2728
2734
|
reloadModules();
|
|
2729
|
-
|
|
2735
|
+
const el = $('<div my-directive="42"></div>');
|
|
2730
2736
|
$compile(el)($rootScope);
|
|
2731
2737
|
await wait();
|
|
2732
2738
|
expect(linkSpy.calls.first().args[0]).not.toBe($rootScope);
|
|
@@ -2736,7 +2742,7 @@ describe("$compile", () => {
|
|
|
2736
2742
|
|
|
2737
2743
|
describe("templateUrl", () => {
|
|
2738
2744
|
it("defers remaining directive compilation", async () => {
|
|
2739
|
-
|
|
2745
|
+
const otherCompileSpy = jasmine.createSpy();
|
|
2740
2746
|
registerDirectives({
|
|
2741
2747
|
myDirective: () => {
|
|
2742
2748
|
return { templateUrl: "/my_directive.html" };
|
|
@@ -2746,14 +2752,14 @@ describe("$compile", () => {
|
|
|
2746
2752
|
},
|
|
2747
2753
|
});
|
|
2748
2754
|
reloadModules();
|
|
2749
|
-
|
|
2755
|
+
const el = $("<div my-directive my-other-directive></div>");
|
|
2750
2756
|
$compile(el);
|
|
2751
2757
|
await wait();
|
|
2752
2758
|
expect(otherCompileSpy).not.toHaveBeenCalled();
|
|
2753
2759
|
});
|
|
2754
2760
|
|
|
2755
2761
|
it("defers current directive compilation", async () => {
|
|
2756
|
-
|
|
2762
|
+
const compileSpy = jasmine.createSpy();
|
|
2757
2763
|
registerDirectives({
|
|
2758
2764
|
myDirective: () => {
|
|
2759
2765
|
return {
|
|
@@ -2763,7 +2769,7 @@ describe("$compile", () => {
|
|
|
2763
2769
|
},
|
|
2764
2770
|
});
|
|
2765
2771
|
reloadModules();
|
|
2766
|
-
|
|
2772
|
+
const el = $("<div my-directive></div>");
|
|
2767
2773
|
$compile(el);
|
|
2768
2774
|
await wait();
|
|
2769
2775
|
expect(compileSpy).not.toHaveBeenCalled();
|
|
@@ -2776,7 +2782,7 @@ describe("$compile", () => {
|
|
|
2776
2782
|
},
|
|
2777
2783
|
});
|
|
2778
2784
|
reloadModules();
|
|
2779
|
-
|
|
2785
|
+
const el = $("<div my-directive>Hello</div>");
|
|
2780
2786
|
$compile(el);
|
|
2781
2787
|
await wait();
|
|
2782
2788
|
expect(el.innerHTML).toBe("");
|
|
@@ -2789,7 +2795,7 @@ describe("$compile", () => {
|
|
|
2789
2795
|
},
|
|
2790
2796
|
});
|
|
2791
2797
|
reloadModules();
|
|
2792
|
-
|
|
2798
|
+
const el = $("<div my-directive></div>");
|
|
2793
2799
|
$compile(el);
|
|
2794
2800
|
setTimeout(() => {
|
|
2795
2801
|
expect(el.children.length).toBe(1);
|
|
@@ -2798,7 +2804,7 @@ describe("$compile", () => {
|
|
|
2798
2804
|
});
|
|
2799
2805
|
|
|
2800
2806
|
it("resumes current directive compilation after template received", (done) => {
|
|
2801
|
-
|
|
2807
|
+
const compileSpy = jasmine.createSpy();
|
|
2802
2808
|
registerDirectives({
|
|
2803
2809
|
myDirective: () => {
|
|
2804
2810
|
return {
|
|
@@ -2808,7 +2814,7 @@ describe("$compile", () => {
|
|
|
2808
2814
|
},
|
|
2809
2815
|
});
|
|
2810
2816
|
reloadModules();
|
|
2811
|
-
|
|
2817
|
+
const el = $("<div my-directive></div>");
|
|
2812
2818
|
|
|
2813
2819
|
$compile(el);
|
|
2814
2820
|
|
|
@@ -2819,7 +2825,7 @@ describe("$compile", () => {
|
|
|
2819
2825
|
});
|
|
2820
2826
|
|
|
2821
2827
|
it("resumes remaining directive compilation after template received", (done) => {
|
|
2822
|
-
|
|
2828
|
+
const otherCompileSpy = jasmine.createSpy();
|
|
2823
2829
|
registerDirectives({
|
|
2824
2830
|
myDirective: () => {
|
|
2825
2831
|
return { templateUrl: "/public/my_directive.html" };
|
|
@@ -2829,7 +2835,7 @@ describe("$compile", () => {
|
|
|
2829
2835
|
},
|
|
2830
2836
|
});
|
|
2831
2837
|
reloadModules();
|
|
2832
|
-
|
|
2838
|
+
const el = $("<div my-directive my-other-directive></div>");
|
|
2833
2839
|
|
|
2834
2840
|
$compile(el);
|
|
2835
2841
|
|
|
@@ -2840,7 +2846,7 @@ describe("$compile", () => {
|
|
|
2840
2846
|
});
|
|
2841
2847
|
|
|
2842
2848
|
it("resumes child compilation after template received", (done) => {
|
|
2843
|
-
|
|
2849
|
+
const otherCompileSpy = jasmine.createSpy();
|
|
2844
2850
|
registerDirectives({
|
|
2845
2851
|
myDirective: () => {
|
|
2846
2852
|
return { templateUrl: "/public/my_other_directive.html" };
|
|
@@ -2850,7 +2856,7 @@ describe("$compile", () => {
|
|
|
2850
2856
|
},
|
|
2851
2857
|
});
|
|
2852
2858
|
reloadModules();
|
|
2853
|
-
|
|
2859
|
+
const el = $("<div my-directive></div>");
|
|
2854
2860
|
|
|
2855
2861
|
$compile(el);
|
|
2856
2862
|
|
|
@@ -2861,7 +2867,7 @@ describe("$compile", () => {
|
|
|
2861
2867
|
});
|
|
2862
2868
|
|
|
2863
2869
|
it("supports functions as values", async () => {
|
|
2864
|
-
|
|
2870
|
+
const templateUrlSpy = jasmine
|
|
2865
2871
|
.createSpy()
|
|
2866
2872
|
.and.returnValue("/public/my_directive.html");
|
|
2867
2873
|
registerDirectives({
|
|
@@ -2872,7 +2878,7 @@ describe("$compile", () => {
|
|
|
2872
2878
|
},
|
|
2873
2879
|
});
|
|
2874
2880
|
reloadModules();
|
|
2875
|
-
|
|
2881
|
+
const el = $("<div my-directive></div>");
|
|
2876
2882
|
|
|
2877
2883
|
$compile(el);
|
|
2878
2884
|
await wait();
|
|
@@ -2890,7 +2896,7 @@ describe("$compile", () => {
|
|
|
2890
2896
|
},
|
|
2891
2897
|
});
|
|
2892
2898
|
reloadModules();
|
|
2893
|
-
|
|
2899
|
+
const el = $("<div my-directive my-other-directive></div>");
|
|
2894
2900
|
expect(() => {
|
|
2895
2901
|
$compile(el);
|
|
2896
2902
|
}).toThrowError();
|
|
@@ -2906,7 +2912,7 @@ describe("$compile", () => {
|
|
|
2906
2912
|
},
|
|
2907
2913
|
});
|
|
2908
2914
|
reloadModules();
|
|
2909
|
-
|
|
2915
|
+
const el = $("<div my-directive my-other-directive></div>");
|
|
2910
2916
|
|
|
2911
2917
|
$compile(el);
|
|
2912
2918
|
|
|
@@ -2917,7 +2923,7 @@ describe("$compile", () => {
|
|
|
2917
2923
|
});
|
|
2918
2924
|
|
|
2919
2925
|
it("links the directive when public link function is invoked", (done) => {
|
|
2920
|
-
|
|
2926
|
+
const linkSpy = jasmine.createSpy();
|
|
2921
2927
|
registerDirectives({
|
|
2922
2928
|
myDirective: () => {
|
|
2923
2929
|
return {
|
|
@@ -2927,9 +2933,9 @@ describe("$compile", () => {
|
|
|
2927
2933
|
},
|
|
2928
2934
|
});
|
|
2929
2935
|
reloadModules();
|
|
2930
|
-
|
|
2936
|
+
const el = $("<div my-directive></div>");
|
|
2931
2937
|
|
|
2932
|
-
|
|
2938
|
+
const linkFunction = $compile(el);
|
|
2933
2939
|
|
|
2934
2940
|
linkFunction($rootScope);
|
|
2935
2941
|
|
|
@@ -2943,7 +2949,7 @@ describe("$compile", () => {
|
|
|
2943
2949
|
});
|
|
2944
2950
|
|
|
2945
2951
|
it("links child elements when public link function is invoked", (done) => {
|
|
2946
|
-
|
|
2952
|
+
const linkSpy = jasmine.createSpy();
|
|
2947
2953
|
registerDirectives({
|
|
2948
2954
|
myDirective: () => {
|
|
2949
2955
|
return { templateUrl: "/public/my_other_directive.html" };
|
|
@@ -2953,9 +2959,9 @@ describe("$compile", () => {
|
|
|
2953
2959
|
},
|
|
2954
2960
|
});
|
|
2955
2961
|
reloadModules();
|
|
2956
|
-
|
|
2962
|
+
const el = $("<div my-directive></div>");
|
|
2957
2963
|
|
|
2958
|
-
|
|
2964
|
+
const linkFunction = $compile(el);
|
|
2959
2965
|
|
|
2960
2966
|
linkFunction($rootScope);
|
|
2961
2967
|
setTimeout(() => {
|
|
@@ -2968,7 +2974,7 @@ describe("$compile", () => {
|
|
|
2968
2974
|
});
|
|
2969
2975
|
|
|
2970
2976
|
it("links when template received if node link function has been invoked", (done) => {
|
|
2971
|
-
|
|
2977
|
+
const linkSpy = jasmine.createSpy();
|
|
2972
2978
|
registerDirectives({
|
|
2973
2979
|
myDirective: () => {
|
|
2974
2980
|
return {
|
|
@@ -2978,9 +2984,9 @@ describe("$compile", () => {
|
|
|
2978
2984
|
},
|
|
2979
2985
|
});
|
|
2980
2986
|
reloadModules();
|
|
2981
|
-
|
|
2987
|
+
const el = $("<div my-directive></div>");
|
|
2982
2988
|
|
|
2983
|
-
|
|
2989
|
+
const linkFunction = $compile(el)($rootScope); // link first
|
|
2984
2990
|
|
|
2985
2991
|
setTimeout(() => {
|
|
2986
2992
|
expect(linkSpy).toHaveBeenCalled();
|
|
@@ -2992,7 +2998,7 @@ describe("$compile", () => {
|
|
|
2992
2998
|
});
|
|
2993
2999
|
|
|
2994
3000
|
it("links directives that were compiled earlier", (done) => {
|
|
2995
|
-
|
|
3001
|
+
const linkSpy = jasmine.createSpy();
|
|
2996
3002
|
registerDirectives({
|
|
2997
3003
|
myDirective: () => {
|
|
2998
3004
|
return {
|
|
@@ -3004,7 +3010,7 @@ describe("$compile", () => {
|
|
|
3004
3010
|
},
|
|
3005
3011
|
});
|
|
3006
3012
|
reloadModules();
|
|
3007
|
-
|
|
3013
|
+
const el = $("<div my-directive my-other-directive></div>");
|
|
3008
3014
|
|
|
3009
3015
|
let linkFunction = $compile(el);
|
|
3010
3016
|
|
|
@@ -3020,7 +3026,7 @@ describe("$compile", () => {
|
|
|
3020
3026
|
});
|
|
3021
3027
|
|
|
3022
3028
|
it("retains isolate scope directives from earlier", (done) => {
|
|
3023
|
-
|
|
3029
|
+
const linkSpy = jasmine.createSpy();
|
|
3024
3030
|
registerDirectives({
|
|
3025
3031
|
myDirective: () => {
|
|
3026
3032
|
return {
|
|
@@ -3033,9 +3039,9 @@ describe("$compile", () => {
|
|
|
3033
3039
|
},
|
|
3034
3040
|
});
|
|
3035
3041
|
reloadModules();
|
|
3036
|
-
|
|
3042
|
+
const el = $('<div my-directive="42" my-other-directive></div>');
|
|
3037
3043
|
|
|
3038
|
-
|
|
3044
|
+
const linkFunction = $compile(el);
|
|
3039
3045
|
linkFunction($rootScope);
|
|
3040
3046
|
|
|
3041
3047
|
setTimeout(() => {
|
|
@@ -3048,7 +3054,7 @@ describe("$compile", () => {
|
|
|
3048
3054
|
});
|
|
3049
3055
|
|
|
3050
3056
|
it("supports isolate scope directives with templateUrls", (done) => {
|
|
3051
|
-
|
|
3057
|
+
const linkSpy = jasmine.createSpy();
|
|
3052
3058
|
registerDirectives({
|
|
3053
3059
|
myDirective: () => {
|
|
3054
3060
|
return {
|
|
@@ -3059,7 +3065,7 @@ describe("$compile", () => {
|
|
|
3059
3065
|
},
|
|
3060
3066
|
});
|
|
3061
3067
|
reloadModules();
|
|
3062
|
-
|
|
3068
|
+
const el = $('<div my-directive="42"></div>');
|
|
3063
3069
|
|
|
3064
3070
|
$compile(el)($rootScope);
|
|
3065
3071
|
setTimeout(() => {
|
|
@@ -3071,7 +3077,7 @@ describe("$compile", () => {
|
|
|
3071
3077
|
});
|
|
3072
3078
|
|
|
3073
3079
|
it("links children of isolate scope directives with templateUrls", (done) => {
|
|
3074
|
-
|
|
3080
|
+
const linkSpy = jasmine.createSpy();
|
|
3075
3081
|
registerDirectives({
|
|
3076
3082
|
myDirective: () => {
|
|
3077
3083
|
return {
|
|
@@ -3086,7 +3092,7 @@ describe("$compile", () => {
|
|
|
3086
3092
|
},
|
|
3087
3093
|
});
|
|
3088
3094
|
reloadModules();
|
|
3089
|
-
|
|
3095
|
+
const el = $('<div my-directive="42"></div>');
|
|
3090
3096
|
$compile(el)($rootScope);
|
|
3091
3097
|
|
|
3092
3098
|
setTimeout(() => {
|
|
@@ -3098,7 +3104,7 @@ describe("$compile", () => {
|
|
|
3098
3104
|
});
|
|
3099
3105
|
|
|
3100
3106
|
it("sets up controllers for all controller directives", (done) => {
|
|
3101
|
-
|
|
3107
|
+
let myDirectiveControllerInstantiated,
|
|
3102
3108
|
myOtherDirectiveControllerInstantiated;
|
|
3103
3109
|
registerDirectives({
|
|
3104
3110
|
myDirective: () => {
|
|
@@ -3118,7 +3124,7 @@ describe("$compile", () => {
|
|
|
3118
3124
|
},
|
|
3119
3125
|
});
|
|
3120
3126
|
reloadModules();
|
|
3121
|
-
|
|
3127
|
+
const el = $("<div my-directive my-other-directive></div>");
|
|
3122
3128
|
|
|
3123
3129
|
$compile(el)($rootScope);
|
|
3124
3130
|
|
|
@@ -3145,9 +3151,9 @@ describe("$compile", () => {
|
|
|
3145
3151
|
},
|
|
3146
3152
|
});
|
|
3147
3153
|
reloadModules();
|
|
3148
|
-
|
|
3154
|
+
const el = $("<div my-transcluder><div in-transclude></div></div>");
|
|
3149
3155
|
|
|
3150
|
-
|
|
3156
|
+
const linkFunction = $compile(el);
|
|
3151
3157
|
|
|
3152
3158
|
linkFunction($rootScope); // then link
|
|
3153
3159
|
setTimeout(() => {
|
|
@@ -3157,7 +3163,7 @@ describe("$compile", () => {
|
|
|
3157
3163
|
});
|
|
3158
3164
|
|
|
3159
3165
|
it("is only allowed once", async () => {
|
|
3160
|
-
|
|
3166
|
+
const otherCompileSpy = jasmine.createSpy();
|
|
3161
3167
|
registerDirectives({
|
|
3162
3168
|
myTranscluder: () => {
|
|
3163
3169
|
return {
|
|
@@ -3175,7 +3181,7 @@ describe("$compile", () => {
|
|
|
3175
3181
|
},
|
|
3176
3182
|
});
|
|
3177
3183
|
reloadModules();
|
|
3178
|
-
|
|
3184
|
+
const el = $("<div my-transcluder my-second-transcluder></div>");
|
|
3179
3185
|
|
|
3180
3186
|
$compile(el);
|
|
3181
3187
|
await wait();
|
|
@@ -3192,14 +3198,14 @@ describe("$compile", () => {
|
|
|
3192
3198
|
},
|
|
3193
3199
|
});
|
|
3194
3200
|
reloadModules();
|
|
3195
|
-
|
|
3201
|
+
const el = $("<div my-transcluder><div>Must go</div></div>");
|
|
3196
3202
|
|
|
3197
3203
|
$compile(el);
|
|
3198
3204
|
expect(el.innerHTML).toBe("");
|
|
3199
3205
|
});
|
|
3200
3206
|
|
|
3201
3207
|
it("compiles child elements", async () => {
|
|
3202
|
-
|
|
3208
|
+
const insideCompileSpy = jasmine.createSpy();
|
|
3203
3209
|
registerDirectives({
|
|
3204
3210
|
myTranscluder: () => {
|
|
3205
3211
|
return {
|
|
@@ -3216,7 +3222,7 @@ describe("$compile", () => {
|
|
|
3216
3222
|
},
|
|
3217
3223
|
});
|
|
3218
3224
|
reloadModules();
|
|
3219
|
-
|
|
3225
|
+
const el = $("<div my-transcluder><div inside-transcluder></div></div>");
|
|
3220
3226
|
$compile(el)($rootScope);
|
|
3221
3227
|
await wait();
|
|
3222
3228
|
expect(insideCompileSpy).toHaveBeenCalledTimes(1);
|
|
@@ -3236,7 +3242,7 @@ describe("$compile", () => {
|
|
|
3236
3242
|
},
|
|
3237
3243
|
});
|
|
3238
3244
|
reloadModules();
|
|
3239
|
-
|
|
3245
|
+
const el = $("<div my-transcluder><div in-transcluder></div></div>");
|
|
3240
3246
|
|
|
3241
3247
|
$compile(el)($rootScope);
|
|
3242
3248
|
expect(el.outerHTML.match(/my-transcluder/)).toBeTruthy();
|
|
@@ -3252,7 +3258,7 @@ describe("$compile", () => {
|
|
|
3252
3258
|
},
|
|
3253
3259
|
});
|
|
3254
3260
|
reloadModules();
|
|
3255
|
-
|
|
3261
|
+
const el = $("<div my-transcluder my-second-transcluder></div>");
|
|
3256
3262
|
|
|
3257
3263
|
expect(() => {
|
|
3258
3264
|
$compile(el);
|
|
@@ -3279,7 +3285,7 @@ describe("$compile", () => {
|
|
|
3279
3285
|
},
|
|
3280
3286
|
});
|
|
3281
3287
|
reloadModules();
|
|
3282
|
-
|
|
3288
|
+
const el = $("<div my-transcluder><div my-inner-directive></div></div>");
|
|
3283
3289
|
|
|
3284
3290
|
$rootScope.anAttr = "Hello from root";
|
|
3285
3291
|
$compile(el)($rootScope);
|
|
@@ -3308,7 +3314,7 @@ describe("$compile", () => {
|
|
|
3308
3314
|
},
|
|
3309
3315
|
});
|
|
3310
3316
|
reloadModules();
|
|
3311
|
-
|
|
3317
|
+
const el = $("<div my-transcluder><div my-inner-directive></div></div>");
|
|
3312
3318
|
|
|
3313
3319
|
$rootScope.anAttr = "Hello from root";
|
|
3314
3320
|
$compile(el)($rootScope);
|
|
@@ -3316,7 +3322,7 @@ describe("$compile", () => {
|
|
|
3316
3322
|
});
|
|
3317
3323
|
|
|
3318
3324
|
it("contents are destroyed along with transcluding directive", async () => {
|
|
3319
|
-
|
|
3325
|
+
const watchSpy = jasmine.createSpy();
|
|
3320
3326
|
registerDirectives({
|
|
3321
3327
|
myTranscluder: () => {
|
|
3322
3328
|
return {
|
|
@@ -3339,7 +3345,7 @@ describe("$compile", () => {
|
|
|
3339
3345
|
},
|
|
3340
3346
|
});
|
|
3341
3347
|
reloadModules();
|
|
3342
|
-
|
|
3348
|
+
const el = $("<div my-transcluder><div my-inner-directive>TEST</div>");
|
|
3343
3349
|
$compile(el)($rootScope);
|
|
3344
3350
|
|
|
3345
3351
|
await wait();
|
|
@@ -3351,7 +3357,7 @@ describe("$compile", () => {
|
|
|
3351
3357
|
});
|
|
3352
3358
|
|
|
3353
3359
|
it("allows passing another scope to transclusion function", async () => {
|
|
3354
|
-
|
|
3360
|
+
const otherLinkSpy = jasmine.createSpy();
|
|
3355
3361
|
registerDirectives({
|
|
3356
3362
|
myTranscluder: () => {
|
|
3357
3363
|
return {
|
|
@@ -3359,7 +3365,7 @@ describe("$compile", () => {
|
|
|
3359
3365
|
scope: {},
|
|
3360
3366
|
template: "<div></div>",
|
|
3361
3367
|
link: function (scope, element, attrs, ctrl, transclude) {
|
|
3362
|
-
|
|
3368
|
+
const mySpecialScope = scope.$new();
|
|
3363
3369
|
mySpecialScope.specialAttr = 42;
|
|
3364
3370
|
transclude(mySpecialScope);
|
|
3365
3371
|
},
|
|
@@ -3370,11 +3376,11 @@ describe("$compile", () => {
|
|
|
3370
3376
|
},
|
|
3371
3377
|
});
|
|
3372
3378
|
reloadModules();
|
|
3373
|
-
|
|
3379
|
+
const el = $("<div my-transcluder><div my-other-directive></div></div>");
|
|
3374
3380
|
|
|
3375
3381
|
$compile(el)($rootScope);
|
|
3376
3382
|
await wait();
|
|
3377
|
-
|
|
3383
|
+
const transcludedScope = otherLinkSpy.calls.first().args[0];
|
|
3378
3384
|
expect(transcludedScope.specialAttr).toBe(42);
|
|
3379
3385
|
});
|
|
3380
3386
|
|
|
@@ -3395,7 +3401,7 @@ describe("$compile", () => {
|
|
|
3395
3401
|
},
|
|
3396
3402
|
});
|
|
3397
3403
|
reloadModules();
|
|
3398
|
-
|
|
3404
|
+
const el = $("<div my-transcluder><div in-transclude></div></div>");
|
|
3399
3405
|
|
|
3400
3406
|
$compile(el)($rootScope);
|
|
3401
3407
|
await wait();
|
|
@@ -3419,7 +3425,7 @@ describe("$compile", () => {
|
|
|
3419
3425
|
},
|
|
3420
3426
|
});
|
|
3421
3427
|
reloadModules();
|
|
3422
|
-
|
|
3428
|
+
const el = $("<div my-transcluder><div in-transclude></div></div>");
|
|
3423
3429
|
|
|
3424
3430
|
$compile(el)($rootScope);
|
|
3425
3431
|
|
|
@@ -3432,7 +3438,7 @@ describe("$compile", () => {
|
|
|
3432
3438
|
return {
|
|
3433
3439
|
transclude: true,
|
|
3434
3440
|
link: function (scope, element, attrs, ctrl, transclude) {
|
|
3435
|
-
|
|
3441
|
+
const customTemplate = $("<div in-custom-template></div>");
|
|
3436
3442
|
element.append(customTemplate);
|
|
3437
3443
|
$compile(customTemplate)(scope, undefined, {
|
|
3438
3444
|
parentBoundTranscludeFn: transclude,
|
|
@@ -3449,7 +3455,7 @@ describe("$compile", () => {
|
|
|
3449
3455
|
},
|
|
3450
3456
|
});
|
|
3451
3457
|
reloadModules();
|
|
3452
|
-
|
|
3458
|
+
const el = $("<div my-transcluder><div in-transclude></div></div>");
|
|
3453
3459
|
|
|
3454
3460
|
$compile(el)($rootScope);
|
|
3455
3461
|
await wait();
|
|
@@ -3457,13 +3463,13 @@ describe("$compile", () => {
|
|
|
3457
3463
|
});
|
|
3458
3464
|
|
|
3459
3465
|
it("destroys scope passed through public link fn at the right time", async () => {
|
|
3460
|
-
|
|
3466
|
+
const watchSpy = jasmine.createSpy();
|
|
3461
3467
|
registerDirectives({
|
|
3462
3468
|
myTranscluder: function ($compile) {
|
|
3463
3469
|
return {
|
|
3464
3470
|
transclude: true,
|
|
3465
3471
|
link: function (scope, element, attrs, ctrl, transclude) {
|
|
3466
|
-
|
|
3472
|
+
const customTemplate = $("<div in-custom-template></div>");
|
|
3467
3473
|
element.append(customTemplate);
|
|
3468
3474
|
$compile(customTemplate)(scope, undefined, {
|
|
3469
3475
|
parentBoundTranscludeFn: transclude,
|
|
@@ -3491,7 +3497,7 @@ describe("$compile", () => {
|
|
|
3491
3497
|
},
|
|
3492
3498
|
});
|
|
3493
3499
|
reloadModules();
|
|
3494
|
-
|
|
3500
|
+
const el = $("<div my-transcluder><div in-transclude></div></div>");
|
|
3495
3501
|
|
|
3496
3502
|
$compile(el)($rootScope);
|
|
3497
3503
|
|
|
@@ -3517,7 +3523,7 @@ describe("$compile", () => {
|
|
|
3517
3523
|
},
|
|
3518
3524
|
});
|
|
3519
3525
|
reloadModules();
|
|
3520
|
-
|
|
3526
|
+
const el = $("<div my-transcluder><div in-transclude></div></div>");
|
|
3521
3527
|
$compile(el)($rootScope);
|
|
3522
3528
|
|
|
3523
3529
|
expect(transclude().outerHTML.match(/in-transclude/)).toBeTruthy();
|
|
@@ -3528,9 +3534,9 @@ describe("$compile", () => {
|
|
|
3528
3534
|
it("can be passed to public link fn", () => {
|
|
3529
3535
|
registerDirectives({});
|
|
3530
3536
|
reloadModules();
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3537
|
+
const el = $("<div>Hello</div>");
|
|
3538
|
+
const myScope = $rootScope.$new();
|
|
3539
|
+
let gotEl, gotScope;
|
|
3534
3540
|
|
|
3535
3541
|
$compile(el)(myScope, function (el, scope) {
|
|
3536
3542
|
gotEl = el;
|
|
@@ -3544,9 +3550,9 @@ describe("$compile", () => {
|
|
|
3544
3550
|
it("causes compiled elements to be cloned", () => {
|
|
3545
3551
|
registerDirectives({});
|
|
3546
3552
|
reloadModules();
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3553
|
+
const el = $("<div>Hello</div>");
|
|
3554
|
+
const myScope = $rootScope.$new();
|
|
3555
|
+
let gotClonedEl;
|
|
3550
3556
|
|
|
3551
3557
|
$compile(el)(myScope, function (clonedEl) {
|
|
3552
3558
|
gotClonedEl = clonedEl;
|
|
@@ -3557,7 +3563,7 @@ describe("$compile", () => {
|
|
|
3557
3563
|
});
|
|
3558
3564
|
|
|
3559
3565
|
it("causes cloned DOM to be linked", () => {
|
|
3560
|
-
|
|
3566
|
+
let gotCompileEl, gotLinkEl;
|
|
3561
3567
|
registerDirectives({
|
|
3562
3568
|
myDirective: () => {
|
|
3563
3569
|
return {
|
|
@@ -3571,8 +3577,8 @@ describe("$compile", () => {
|
|
|
3571
3577
|
},
|
|
3572
3578
|
});
|
|
3573
3579
|
reloadModules();
|
|
3574
|
-
|
|
3575
|
-
|
|
3580
|
+
const el = $("<div my-directive></div>");
|
|
3581
|
+
const myScope = $rootScope.$new();
|
|
3576
3582
|
|
|
3577
3583
|
$compile(el)(myScope, () => {});
|
|
3578
3584
|
|
|
@@ -3586,7 +3592,7 @@ describe("$compile", () => {
|
|
|
3586
3592
|
transclude: true,
|
|
3587
3593
|
template: "<div in-template></div>",
|
|
3588
3594
|
link: function (scope, element, attrs, ctrl, transcludeFn) {
|
|
3589
|
-
|
|
3595
|
+
const myScope = scope.$new();
|
|
3590
3596
|
transcludeFn(myScope, function (transclNode) {
|
|
3591
3597
|
element.append(transclNode);
|
|
3592
3598
|
});
|
|
@@ -3595,7 +3601,7 @@ describe("$compile", () => {
|
|
|
3595
3601
|
},
|
|
3596
3602
|
});
|
|
3597
3603
|
reloadModules();
|
|
3598
|
-
|
|
3604
|
+
const el = $("<div my-transcluder><div in-transclude></div></div>");
|
|
3599
3605
|
|
|
3600
3606
|
$compile(el)($rootScope);
|
|
3601
3607
|
|
|
@@ -3617,7 +3623,7 @@ describe("$compile", () => {
|
|
|
3617
3623
|
},
|
|
3618
3624
|
});
|
|
3619
3625
|
reloadModules();
|
|
3620
|
-
|
|
3626
|
+
const el = $("<div my-transcluder><div in-transclusion></div></div>");
|
|
3621
3627
|
|
|
3622
3628
|
$compile(el)($rootScope);
|
|
3623
3629
|
expect(el.outerHTML.match(/in-transclusion/)).toBeTruthy();
|
|
@@ -3646,7 +3652,7 @@ describe("$compile", () => {
|
|
|
3646
3652
|
},
|
|
3647
3653
|
});
|
|
3648
3654
|
reloadModules();
|
|
3649
|
-
|
|
3655
|
+
const el = $("<div my-transcluder><div my-other-directive></div></div>");
|
|
3650
3656
|
|
|
3651
3657
|
$compile(el)($rootScope);
|
|
3652
3658
|
expect(el.outerHTML.match(/Hello from transcluder/)).toBeTruthy();
|
|
@@ -3663,7 +3669,7 @@ describe("$compile", () => {
|
|
|
3663
3669
|
},
|
|
3664
3670
|
});
|
|
3665
3671
|
reloadModules();
|
|
3666
|
-
|
|
3672
|
+
const el = $("<div><div my-transcluder></div></div>");
|
|
3667
3673
|
|
|
3668
3674
|
$compile(el);
|
|
3669
3675
|
expect(el.innerText).toBe("");
|
|
@@ -3678,7 +3684,7 @@ describe("$compile", () => {
|
|
|
3678
3684
|
},
|
|
3679
3685
|
});
|
|
3680
3686
|
reloadModules();
|
|
3681
|
-
|
|
3687
|
+
const el = $("<div><div my-transcluder></div></div>");
|
|
3682
3688
|
|
|
3683
3689
|
$compile(el);
|
|
3684
3690
|
|
|
@@ -3692,7 +3698,7 @@ describe("$compile", () => {
|
|
|
3692
3698
|
},
|
|
3693
3699
|
});
|
|
3694
3700
|
reloadModules();
|
|
3695
|
-
|
|
3701
|
+
const el = $("<div><div my-transcluder=42></div></div>");
|
|
3696
3702
|
|
|
3697
3703
|
$compile(el);
|
|
3698
3704
|
|
|
@@ -3700,7 +3706,7 @@ describe("$compile", () => {
|
|
|
3700
3706
|
});
|
|
3701
3707
|
|
|
3702
3708
|
it("calls directive compile and link with comment", () => {
|
|
3703
|
-
|
|
3709
|
+
let gotCompiledEl, gotLinkedEl;
|
|
3704
3710
|
registerDirectives({
|
|
3705
3711
|
myTranscluder: () => {
|
|
3706
3712
|
return {
|
|
@@ -3715,7 +3721,7 @@ describe("$compile", () => {
|
|
|
3715
3721
|
},
|
|
3716
3722
|
});
|
|
3717
3723
|
reloadModules();
|
|
3718
|
-
|
|
3724
|
+
const el = $("<div><div my-transcluder></div></div>");
|
|
3719
3725
|
|
|
3720
3726
|
$compile(el)($rootScope);
|
|
3721
3727
|
|
|
@@ -3724,7 +3730,7 @@ describe("$compile", () => {
|
|
|
3724
3730
|
});
|
|
3725
3731
|
|
|
3726
3732
|
it("calls lower priority compile with original", () => {
|
|
3727
|
-
|
|
3733
|
+
let gotCompiledEl;
|
|
3728
3734
|
registerDirectives({
|
|
3729
3735
|
myTranscluder: () => {
|
|
3730
3736
|
return {
|
|
@@ -3745,14 +3751,14 @@ describe("$compile", () => {
|
|
|
3745
3751
|
},
|
|
3746
3752
|
});
|
|
3747
3753
|
reloadModules();
|
|
3748
|
-
|
|
3754
|
+
const el = $("<div my-other-directive my-transcluder></div>");
|
|
3749
3755
|
|
|
3750
3756
|
$compile(el);
|
|
3751
3757
|
expect(gotCompiledEl.nodeType).toBe(Node.ELEMENT_NODE);
|
|
3752
3758
|
});
|
|
3753
3759
|
|
|
3754
3760
|
it("calls compile on child element directives", () => {
|
|
3755
|
-
|
|
3761
|
+
const compileSpy = jasmine.createSpy();
|
|
3756
3762
|
registerDirectives({
|
|
3757
3763
|
myTranscluder: () => {
|
|
3758
3764
|
return {
|
|
@@ -3767,7 +3773,7 @@ describe("$compile", () => {
|
|
|
3767
3773
|
},
|
|
3768
3774
|
});
|
|
3769
3775
|
reloadModules();
|
|
3770
|
-
|
|
3776
|
+
const el = $(
|
|
3771
3777
|
"<div><div my-transcluder><div my-other-directive></div></div></div>",
|
|
3772
3778
|
);
|
|
3773
3779
|
$compile(el)($rootScope);
|
|
@@ -3776,7 +3782,7 @@ describe("$compile", () => {
|
|
|
3776
3782
|
});
|
|
3777
3783
|
|
|
3778
3784
|
it("compiles original element contents once", () => {
|
|
3779
|
-
|
|
3785
|
+
const compileSpy = jasmine.createSpy();
|
|
3780
3786
|
registerDirectives({
|
|
3781
3787
|
myTranscluder: () => {
|
|
3782
3788
|
return { transclude: true, template: "<div ng-transclude></div>" };
|
|
@@ -3788,7 +3794,7 @@ describe("$compile", () => {
|
|
|
3788
3794
|
},
|
|
3789
3795
|
});
|
|
3790
3796
|
reloadModules();
|
|
3791
|
-
|
|
3797
|
+
const el = $(
|
|
3792
3798
|
"<div><div my-transcluder><div my-other-directive></div></div></div>",
|
|
3793
3799
|
);
|
|
3794
3800
|
|
|
@@ -3815,15 +3821,15 @@ describe("$compile", () => {
|
|
|
3815
3821
|
},
|
|
3816
3822
|
});
|
|
3817
3823
|
reloadModules();
|
|
3818
|
-
|
|
3824
|
+
const el = $("<div><div my-double>Hello</div></div>");
|
|
3819
3825
|
|
|
3820
3826
|
$compile(el)($rootScope);
|
|
3821
3827
|
expect(el.innerText).toBe("HelloHelloHello");
|
|
3822
3828
|
});
|
|
3823
3829
|
|
|
3824
3830
|
it("supports requiring controllers", () => {
|
|
3825
|
-
|
|
3826
|
-
|
|
3831
|
+
const MyController = function () {};
|
|
3832
|
+
let gotCtrl;
|
|
3827
3833
|
registerDirectives({
|
|
3828
3834
|
myCtrlDirective: () => {
|
|
3829
3835
|
return { controller: MyController };
|
|
@@ -3846,7 +3852,7 @@ describe("$compile", () => {
|
|
|
3846
3852
|
},
|
|
3847
3853
|
});
|
|
3848
3854
|
reloadModules();
|
|
3849
|
-
|
|
3855
|
+
const el = $(
|
|
3850
3856
|
"<div><div my-ctrl-directive my-transcluder><div my-other-directive>Hello</div></div>",
|
|
3851
3857
|
);
|
|
3852
3858
|
|
|
@@ -3861,7 +3867,7 @@ describe("$compile", () => {
|
|
|
3861
3867
|
it("is done for text nodes", async () => {
|
|
3862
3868
|
registerDirectives({});
|
|
3863
3869
|
reloadModules();
|
|
3864
|
-
|
|
3870
|
+
const el = $("<div>My expression: {{myExpr}}</div>");
|
|
3865
3871
|
$compile(el)($rootScope);
|
|
3866
3872
|
|
|
3867
3873
|
await wait();
|
|
@@ -3875,7 +3881,7 @@ describe("$compile", () => {
|
|
|
3875
3881
|
it("is done for attributes", async () => {
|
|
3876
3882
|
registerDirectives({});
|
|
3877
3883
|
reloadModules();
|
|
3878
|
-
|
|
3884
|
+
const el = $('<img alt="{{myAltText}}">');
|
|
3879
3885
|
$compile(el)($rootScope);
|
|
3880
3886
|
|
|
3881
3887
|
await wait();
|
|
@@ -3888,7 +3894,7 @@ describe("$compile", () => {
|
|
|
3888
3894
|
});
|
|
3889
3895
|
|
|
3890
3896
|
it("fires observers on attribute expression changes", async () => {
|
|
3891
|
-
|
|
3897
|
+
const observerSpy = jasmine.createSpy();
|
|
3892
3898
|
registerDirectives({
|
|
3893
3899
|
myDirective: () => {
|
|
3894
3900
|
return {
|
|
@@ -3899,7 +3905,7 @@ describe("$compile", () => {
|
|
|
3899
3905
|
},
|
|
3900
3906
|
});
|
|
3901
3907
|
reloadModules();
|
|
3902
|
-
|
|
3908
|
+
const el = $('<img alt="{{myAltText}}" my-directive>');
|
|
3903
3909
|
$compile(el)($rootScope);
|
|
3904
3910
|
|
|
3905
3911
|
$rootScope.myAltText = "My favourite photo";
|
|
@@ -3910,7 +3916,7 @@ describe("$compile", () => {
|
|
|
3910
3916
|
});
|
|
3911
3917
|
|
|
3912
3918
|
it("fires observers just once upon registration", async () => {
|
|
3913
|
-
|
|
3919
|
+
const observerSpy = jasmine.createSpy();
|
|
3914
3920
|
registerDirectives({
|
|
3915
3921
|
myDirective: () => {
|
|
3916
3922
|
return {
|
|
@@ -3921,14 +3927,14 @@ describe("$compile", () => {
|
|
|
3921
3927
|
},
|
|
3922
3928
|
});
|
|
3923
3929
|
reloadModules();
|
|
3924
|
-
|
|
3930
|
+
const el = $('<img alt="{{myAltText}}" my-directive>');
|
|
3925
3931
|
$compile(el)($rootScope);
|
|
3926
3932
|
await wait();
|
|
3927
3933
|
expect(observerSpy.calls.count()).toBe(1);
|
|
3928
3934
|
});
|
|
3929
3935
|
|
|
3930
3936
|
it("is done for attributes by the time other directive is linked", async () => {
|
|
3931
|
-
|
|
3937
|
+
let gotMyAttr;
|
|
3932
3938
|
registerDirectives({
|
|
3933
3939
|
myDirective: () => {
|
|
3934
3940
|
return {
|
|
@@ -3939,7 +3945,7 @@ describe("$compile", () => {
|
|
|
3939
3945
|
},
|
|
3940
3946
|
});
|
|
3941
3947
|
reloadModules();
|
|
3942
|
-
|
|
3948
|
+
const el = $('<div my-directive my-attr="{{myExpr}}"></div>');
|
|
3943
3949
|
$rootScope.myExpr = "Hello";
|
|
3944
3950
|
$compile(el)($rootScope);
|
|
3945
3951
|
await wait();
|
|
@@ -3947,7 +3953,7 @@ describe("$compile", () => {
|
|
|
3947
3953
|
});
|
|
3948
3954
|
|
|
3949
3955
|
it("is done for attributes by the time bound to iso scope", async () => {
|
|
3950
|
-
|
|
3956
|
+
let gotMyAttr;
|
|
3951
3957
|
registerDirectives({
|
|
3952
3958
|
myDirective: () => {
|
|
3953
3959
|
return {
|
|
@@ -3959,7 +3965,7 @@ describe("$compile", () => {
|
|
|
3959
3965
|
},
|
|
3960
3966
|
});
|
|
3961
3967
|
reloadModules();
|
|
3962
|
-
|
|
3968
|
+
const el = $('<div my-directive my-attr="{{myExpr}}"></div>');
|
|
3963
3969
|
$rootScope.myExpr = "Hello";
|
|
3964
3970
|
$compile(el)($rootScope);
|
|
3965
3971
|
await wait();
|
|
@@ -3978,7 +3984,7 @@ describe("$compile", () => {
|
|
|
3978
3984
|
},
|
|
3979
3985
|
});
|
|
3980
3986
|
reloadModules();
|
|
3981
|
-
|
|
3987
|
+
const el = $('<div my-directive my-attr="{{myExpr}}"></div>');
|
|
3982
3988
|
$rootScope.myExpr = "Hello";
|
|
3983
3989
|
$rootScope.myDifferentExpr = "Other Hello";
|
|
3984
3990
|
$compile(el)($rootScope);
|
|
@@ -3998,7 +4004,7 @@ describe("$compile", () => {
|
|
|
3998
4004
|
},
|
|
3999
4005
|
});
|
|
4000
4006
|
reloadModules();
|
|
4001
|
-
|
|
4007
|
+
const el = $('<div my-directive my-attr="{{myExpr}}"></div>');
|
|
4002
4008
|
$rootScope.myExpr = "Hello";
|
|
4003
4009
|
$compile(el)($rootScope);
|
|
4004
4010
|
await wait();
|
|
@@ -4010,7 +4016,7 @@ describe("$compile", () => {
|
|
|
4010
4016
|
registerDirectives({});
|
|
4011
4017
|
reloadModules();
|
|
4012
4018
|
$rootScope.myFunction = () => {};
|
|
4013
|
-
|
|
4019
|
+
const el = $('<button onclick="{{myFunction()}}"></button>');
|
|
4014
4020
|
expect(() => {
|
|
4015
4021
|
$compile(el)($rootScope);
|
|
4016
4022
|
}).toThrowError();
|
|
@@ -4029,7 +4035,7 @@ describe("$compile", () => {
|
|
|
4029
4035
|
});
|
|
4030
4036
|
},
|
|
4031
4037
|
]).invoke(async ($compile, $rootScope) => {
|
|
4032
|
-
|
|
4038
|
+
const el = $("<div my-directive></div>");
|
|
4033
4039
|
$rootScope.myExpr = 42;
|
|
4034
4040
|
$compile(el)($rootScope);
|
|
4035
4041
|
await wait();
|
|
@@ -4043,13 +4049,13 @@ describe("$compile", () => {
|
|
|
4043
4049
|
describe("components", () => {
|
|
4044
4050
|
it("can be registered and become directives", () => {
|
|
4045
4051
|
myModule.component("myComponent", {});
|
|
4046
|
-
|
|
4052
|
+
const injector = createInjector(["ng", "myModule"]);
|
|
4047
4053
|
expect(injector.has("myComponentDirective")).toBe(true);
|
|
4048
4054
|
});
|
|
4049
4055
|
|
|
4050
4056
|
it("are element directives with controllers", () => {
|
|
4051
|
-
|
|
4052
|
-
|
|
4057
|
+
let controllerInstantiated = false;
|
|
4058
|
+
let componentElement;
|
|
4053
4059
|
myModule.component("myComponent", {
|
|
4054
4060
|
controller: function ($element) {
|
|
4055
4061
|
controllerInstantiated = true;
|
|
@@ -4059,7 +4065,7 @@ describe("$compile", () => {
|
|
|
4059
4065
|
});
|
|
4060
4066
|
|
|
4061
4067
|
reloadModules();
|
|
4062
|
-
|
|
4068
|
+
const el = $("<my-component></my-component>");
|
|
4063
4069
|
$compile(el)($rootScope);
|
|
4064
4070
|
|
|
4065
4071
|
expect(controllerInstantiated).toBe(true);
|
|
@@ -4067,7 +4073,7 @@ describe("$compile", () => {
|
|
|
4067
4073
|
});
|
|
4068
4074
|
|
|
4069
4075
|
it("cannot be applied to an attribute", async () => {
|
|
4070
|
-
|
|
4076
|
+
let controllerInstantiated = false;
|
|
4071
4077
|
registerComponent("myComponent", {
|
|
4072
4078
|
restrict: "A", // Will be ignored
|
|
4073
4079
|
controller: () => {
|
|
@@ -4075,21 +4081,21 @@ describe("$compile", () => {
|
|
|
4075
4081
|
},
|
|
4076
4082
|
});
|
|
4077
4083
|
reloadModules();
|
|
4078
|
-
|
|
4084
|
+
const el = $("<div my-component></div>");
|
|
4079
4085
|
$compile(el)($rootScope);
|
|
4080
4086
|
await wait();
|
|
4081
4087
|
expect(controllerInstantiated).toBe(false);
|
|
4082
4088
|
});
|
|
4083
4089
|
|
|
4084
4090
|
it("has an isolate scope", async () => {
|
|
4085
|
-
|
|
4091
|
+
let componentScope;
|
|
4086
4092
|
myModule.component("myComponent", {
|
|
4087
4093
|
controller: function ($scope) {
|
|
4088
4094
|
componentScope = $scope;
|
|
4089
4095
|
},
|
|
4090
4096
|
});
|
|
4091
4097
|
reloadModules();
|
|
4092
|
-
|
|
4098
|
+
const el = $("<my-component></my-component>");
|
|
4093
4099
|
$compile(el)($rootScope);
|
|
4094
4100
|
await wait();
|
|
4095
4101
|
expect(componentScope.$id).not.toBe($rootScope.$id);
|
|
@@ -4098,7 +4104,7 @@ describe("$compile", () => {
|
|
|
4098
4104
|
});
|
|
4099
4105
|
|
|
4100
4106
|
it("may have bindings which are attached to controller", async () => {
|
|
4101
|
-
|
|
4107
|
+
let controllerInstance;
|
|
4102
4108
|
myModule.component("myComponent", {
|
|
4103
4109
|
bindings: {
|
|
4104
4110
|
attr: "@",
|
|
@@ -4112,7 +4118,7 @@ describe("$compile", () => {
|
|
|
4112
4118
|
reloadModules();
|
|
4113
4119
|
$rootScope.b = 42;
|
|
4114
4120
|
$rootScope.c = 43;
|
|
4115
|
-
|
|
4121
|
+
const el = $(
|
|
4116
4122
|
'<my-component attr="a", one-way="b", two-way="c"></my-component>',
|
|
4117
4123
|
);
|
|
4118
4124
|
$compile(el)($rootScope);
|
|
@@ -4123,8 +4129,8 @@ describe("$compile", () => {
|
|
|
4123
4129
|
});
|
|
4124
4130
|
|
|
4125
4131
|
it("may use a controller alias with controllerAs", async () => {
|
|
4126
|
-
|
|
4127
|
-
|
|
4132
|
+
let componentScope;
|
|
4133
|
+
let controllerInstance;
|
|
4128
4134
|
myModule.component("myComponent", {
|
|
4129
4135
|
controller: function ($scope) {
|
|
4130
4136
|
componentScope = $scope;
|
|
@@ -4133,15 +4139,15 @@ describe("$compile", () => {
|
|
|
4133
4139
|
controllerAs: "myComponentController",
|
|
4134
4140
|
});
|
|
4135
4141
|
reloadModules();
|
|
4136
|
-
|
|
4142
|
+
const el = $("<my-component></my-component>");
|
|
4137
4143
|
$compile(el)($rootScope);
|
|
4138
4144
|
await wait();
|
|
4139
4145
|
expect(componentScope.myComponentController).toEqual(controllerInstance);
|
|
4140
4146
|
});
|
|
4141
4147
|
|
|
4142
4148
|
it('may use a controller alias with "controller as" syntax', async () => {
|
|
4143
|
-
|
|
4144
|
-
|
|
4149
|
+
let componentScope;
|
|
4150
|
+
let controllerInstance;
|
|
4145
4151
|
myModule
|
|
4146
4152
|
.controller("MyController", function ($scope) {
|
|
4147
4153
|
componentScope = $scope;
|
|
@@ -4151,15 +4157,15 @@ describe("$compile", () => {
|
|
|
4151
4157
|
controller: "MyController as myComponentController",
|
|
4152
4158
|
});
|
|
4153
4159
|
reloadModules();
|
|
4154
|
-
|
|
4160
|
+
const el = $("<my-component></my-component");
|
|
4155
4161
|
$compile(el)($rootScope);
|
|
4156
4162
|
await wait();
|
|
4157
4163
|
expect(componentScope.myComponentController).toEqual(controllerInstance);
|
|
4158
4164
|
});
|
|
4159
4165
|
|
|
4160
4166
|
it("has a default controller alias of $ctrl", async () => {
|
|
4161
|
-
|
|
4162
|
-
|
|
4167
|
+
let componentScope;
|
|
4168
|
+
let controllerInstance;
|
|
4163
4169
|
myModule.component("myComponent", {
|
|
4164
4170
|
controller: function ($scope) {
|
|
4165
4171
|
componentScope = $scope;
|
|
@@ -4167,7 +4173,7 @@ describe("$compile", () => {
|
|
|
4167
4173
|
},
|
|
4168
4174
|
});
|
|
4169
4175
|
reloadModules();
|
|
4170
|
-
|
|
4176
|
+
const el = $("<my-component></my-component>");
|
|
4171
4177
|
$compile(el)($rootScope);
|
|
4172
4178
|
await wait();
|
|
4173
4179
|
expect(componentScope.$ctrl).toEqual(controllerInstance);
|
|
@@ -4181,7 +4187,7 @@ describe("$compile", () => {
|
|
|
4181
4187
|
template: "{{ $ctrl.message }}",
|
|
4182
4188
|
});
|
|
4183
4189
|
reloadModules();
|
|
4184
|
-
|
|
4190
|
+
const el = $("<my-component></my-component>");
|
|
4185
4191
|
$compile(el)($rootScope);
|
|
4186
4192
|
await wait();
|
|
4187
4193
|
expect(el.innerText).toEqual("Hello from component");
|
|
@@ -4196,7 +4202,7 @@ describe("$compile", () => {
|
|
|
4196
4202
|
});
|
|
4197
4203
|
reloadModules();
|
|
4198
4204
|
$templateCache.set("/my_component.html", "{{ $ctrl.message }}");
|
|
4199
|
-
|
|
4205
|
+
const el = $("<my-component></my-component>");
|
|
4200
4206
|
$compile(el)($rootScope);
|
|
4201
4207
|
setTimeout(() => {
|
|
4202
4208
|
expect(el.innerText).toEqual("Hello from component");
|
|
@@ -4211,7 +4217,7 @@ describe("$compile", () => {
|
|
|
4211
4217
|
},
|
|
4212
4218
|
});
|
|
4213
4219
|
reloadModules();
|
|
4214
|
-
|
|
4220
|
+
const el = $("<my-component></my-component>");
|
|
4215
4221
|
$compile(el)($rootScope);
|
|
4216
4222
|
await wait();
|
|
4217
4223
|
expect(el.innerText).toEqual("42");
|
|
@@ -4227,7 +4233,7 @@ describe("$compile", () => {
|
|
|
4227
4233
|
],
|
|
4228
4234
|
});
|
|
4229
4235
|
reloadModules();
|
|
4230
|
-
|
|
4236
|
+
const el = $("<my-component></my-component>");
|
|
4231
4237
|
$compile(el)($rootScope);
|
|
4232
4238
|
expect(el.innerText).toEqual("42");
|
|
4233
4239
|
});
|
|
@@ -4239,7 +4245,7 @@ describe("$compile", () => {
|
|
|
4239
4245
|
},
|
|
4240
4246
|
});
|
|
4241
4247
|
reloadModules();
|
|
4242
|
-
|
|
4248
|
+
const el = $('<my-component my-attr="42"></my-component>');
|
|
4243
4249
|
$compile(el)($rootScope);
|
|
4244
4250
|
await wait();
|
|
4245
4251
|
expect(el.getAttribute("copiedAttr")).toEqual("42");
|
|
@@ -4253,7 +4259,7 @@ describe("$compile", () => {
|
|
|
4253
4259
|
});
|
|
4254
4260
|
$templateCache.set("/template42.html", "{{ 1 + 1 }}");
|
|
4255
4261
|
reloadModules();
|
|
4256
|
-
|
|
4262
|
+
const el = $("<my-component></my-component>");
|
|
4257
4263
|
$compile(el)($rootScope);
|
|
4258
4264
|
await wait();
|
|
4259
4265
|
expect(el.innerText).toEqual("2");
|
|
@@ -4265,13 +4271,13 @@ describe("$compile", () => {
|
|
|
4265
4271
|
template: "<div ng-transclude></div>",
|
|
4266
4272
|
});
|
|
4267
4273
|
reloadModules();
|
|
4268
|
-
|
|
4274
|
+
const el = $("<my-component>Transclude me</my-component>");
|
|
4269
4275
|
$compile(el)($rootScope);
|
|
4270
4276
|
expect(el.children[0].innerText).toEqual("Transclude me");
|
|
4271
4277
|
});
|
|
4272
4278
|
|
|
4273
4279
|
it("may require other directive controllers", () => {
|
|
4274
|
-
|
|
4280
|
+
let secondControllerInstance;
|
|
4275
4281
|
myModule
|
|
4276
4282
|
.component("first", {
|
|
4277
4283
|
controller: () => {},
|
|
@@ -4283,7 +4289,7 @@ describe("$compile", () => {
|
|
|
4283
4289
|
},
|
|
4284
4290
|
});
|
|
4285
4291
|
reloadModules();
|
|
4286
|
-
|
|
4292
|
+
const el = $("<first><second></second></first>");
|
|
4287
4293
|
$compile(el)($rootScope);
|
|
4288
4294
|
expect(secondControllerInstance.first).toBeDefined();
|
|
4289
4295
|
});
|
|
@@ -4291,7 +4297,7 @@ describe("$compile", () => {
|
|
|
4291
4297
|
|
|
4292
4298
|
describe("lifecycle", () => {
|
|
4293
4299
|
it("calls $onInit after all ctrls created before linking", () => {
|
|
4294
|
-
|
|
4300
|
+
const invocations = [];
|
|
4295
4301
|
myModule
|
|
4296
4302
|
.component("first", {
|
|
4297
4303
|
controller: function () {
|
|
@@ -4321,7 +4327,7 @@ describe("$compile", () => {
|
|
|
4321
4327
|
});
|
|
4322
4328
|
|
|
4323
4329
|
reloadModules();
|
|
4324
|
-
|
|
4330
|
+
const el = $("<first second></first>");
|
|
4325
4331
|
$compile(el)($rootScope);
|
|
4326
4332
|
expect(invocations).toEqual([
|
|
4327
4333
|
"first controller created",
|
|
@@ -4334,21 +4340,21 @@ describe("$compile", () => {
|
|
|
4334
4340
|
});
|
|
4335
4341
|
|
|
4336
4342
|
it("calls $onDestroy when the scope is destroyed", () => {
|
|
4337
|
-
|
|
4343
|
+
const destroySpy = jasmine.createSpy();
|
|
4338
4344
|
myModule.component("myComponent", {
|
|
4339
4345
|
controller: function () {
|
|
4340
4346
|
this.$onDestroy = destroySpy;
|
|
4341
4347
|
},
|
|
4342
4348
|
});
|
|
4343
4349
|
reloadModules();
|
|
4344
|
-
|
|
4350
|
+
const el = $("<my-component></my-component>");
|
|
4345
4351
|
$compile(el)($rootScope);
|
|
4346
4352
|
$rootScope.$destroy();
|
|
4347
4353
|
expect(destroySpy).toHaveBeenCalled();
|
|
4348
4354
|
});
|
|
4349
4355
|
|
|
4350
4356
|
it("calls $postLink after all linking is done", () => {
|
|
4351
|
-
|
|
4357
|
+
const invocations = [];
|
|
4352
4358
|
myModule
|
|
4353
4359
|
.component("first", {
|
|
4354
4360
|
controller: function () {
|
|
@@ -4371,7 +4377,7 @@ describe("$compile", () => {
|
|
|
4371
4377
|
});
|
|
4372
4378
|
|
|
4373
4379
|
reloadModules();
|
|
4374
|
-
|
|
4380
|
+
const el = $("<first><second></second></first>");
|
|
4375
4381
|
$compile(el)($rootScope);
|
|
4376
4382
|
expect(invocations).toEqual([
|
|
4377
4383
|
"second postlink",
|
|
@@ -4381,7 +4387,7 @@ describe("$compile", () => {
|
|
|
4381
4387
|
});
|
|
4382
4388
|
|
|
4383
4389
|
it("does not call $onChanges for two-way bindings", () => {
|
|
4384
|
-
|
|
4390
|
+
const changesSpy = jasmine.createSpy();
|
|
4385
4391
|
myModule.component("myComponent", {
|
|
4386
4392
|
bindings: {
|
|
4387
4393
|
myBinding: "=",
|
|
@@ -4391,14 +4397,14 @@ describe("$compile", () => {
|
|
|
4391
4397
|
},
|
|
4392
4398
|
});
|
|
4393
4399
|
reloadModules();
|
|
4394
|
-
|
|
4400
|
+
const el = $('<my-component my-binding="42"></my-component>');
|
|
4395
4401
|
$compile(el)($rootScope);
|
|
4396
4402
|
expect(changesSpy).toHaveBeenCalled();
|
|
4397
4403
|
expect(changesSpy.calls.mostRecent().args[0].myBinding).toBeUndefined();
|
|
4398
4404
|
});
|
|
4399
4405
|
|
|
4400
4406
|
it("calls $onChanges when binding changes", async () => {
|
|
4401
|
-
|
|
4407
|
+
const changesSpy = jasmine.createSpy();
|
|
4402
4408
|
myModule.component("myComponent", {
|
|
4403
4409
|
bindings: {
|
|
4404
4410
|
myBinding: "<",
|
|
@@ -4411,7 +4417,7 @@ describe("$compile", () => {
|
|
|
4411
4417
|
});
|
|
4412
4418
|
reloadModules();
|
|
4413
4419
|
$rootScope.aValue = 42;
|
|
4414
|
-
|
|
4420
|
+
const el = $('<my-component my-binding="aValue"></my-component>');
|
|
4415
4421
|
$compile(el)($rootScope);
|
|
4416
4422
|
await wait();
|
|
4417
4423
|
|
|
@@ -4420,14 +4426,14 @@ describe("$compile", () => {
|
|
|
4420
4426
|
await wait();
|
|
4421
4427
|
expect(changesSpy.calls.count()).toBe(2);
|
|
4422
4428
|
|
|
4423
|
-
|
|
4429
|
+
const lastChanges = changesSpy.calls.mostRecent().args[0];
|
|
4424
4430
|
expect(lastChanges.myBinding.currentValue).toBe(43);
|
|
4425
4431
|
expect(lastChanges.myBinding.firstChange).toBe(true);
|
|
4426
4432
|
});
|
|
4427
4433
|
|
|
4428
4434
|
it("calls $onChanges when attribute changes", async () => {
|
|
4429
|
-
|
|
4430
|
-
|
|
4435
|
+
const changesSpy = jasmine.createSpy();
|
|
4436
|
+
let attrs;
|
|
4431
4437
|
myModule.component("myComponent", {
|
|
4432
4438
|
bindings: {
|
|
4433
4439
|
myAttr: "@",
|
|
@@ -4440,21 +4446,21 @@ describe("$compile", () => {
|
|
|
4440
4446
|
},
|
|
4441
4447
|
});
|
|
4442
4448
|
reloadModules();
|
|
4443
|
-
|
|
4449
|
+
const el = $('<my-component my-attr="42"></my-component>');
|
|
4444
4450
|
$compile(el)($rootScope);
|
|
4445
4451
|
await wait();
|
|
4446
4452
|
expect(changesSpy.calls.count()).toBe(1);
|
|
4447
4453
|
attrs.$set("myAttr", "43");
|
|
4448
4454
|
await wait();
|
|
4449
4455
|
expect(changesSpy.calls.count()).toBe(2);
|
|
4450
|
-
|
|
4456
|
+
const lastChanges = changesSpy.calls.mostRecent().args[0];
|
|
4451
4457
|
expect(lastChanges.myAttr.currentValue).toBe("43");
|
|
4452
4458
|
expect(lastChanges.myAttr.firstChange).toBe(true);
|
|
4453
4459
|
});
|
|
4454
4460
|
|
|
4455
4461
|
it("calls $onChanges once with multiple changes", async () => {
|
|
4456
|
-
|
|
4457
|
-
|
|
4462
|
+
const changesSpy = jasmine.createSpy();
|
|
4463
|
+
let attrs;
|
|
4458
4464
|
myModule.component("myComponent", {
|
|
4459
4465
|
bindings: {
|
|
4460
4466
|
myBinding: "<",
|
|
@@ -4469,7 +4475,7 @@ describe("$compile", () => {
|
|
|
4469
4475
|
});
|
|
4470
4476
|
reloadModules();
|
|
4471
4477
|
$rootScope.aValue = 42;
|
|
4472
|
-
|
|
4478
|
+
const el = $(
|
|
4473
4479
|
'<my-component my-binding="aValue" my-attr="fourtyTwo"></my-component>',
|
|
4474
4480
|
);
|
|
4475
4481
|
$compile(el)($rootScope);
|
|
@@ -4480,7 +4486,7 @@ describe("$compile", () => {
|
|
|
4480
4486
|
|
|
4481
4487
|
await wait();
|
|
4482
4488
|
expect(changesSpy.calls.count()).toBe(2);
|
|
4483
|
-
|
|
4489
|
+
let lastChanges = changesSpy.calls.mostRecent().args[0];
|
|
4484
4490
|
expect(lastChanges.myAttr.currentValue).toBe("fourtyTwo");
|
|
4485
4491
|
|
|
4486
4492
|
attrs.$set("myAttr", "fourtyThree");
|
|
@@ -4509,7 +4515,7 @@ describe("$compile", () => {
|
|
|
4509
4515
|
});
|
|
4510
4516
|
reloadModules();
|
|
4511
4517
|
$rootScope.aValue = 42;
|
|
4512
|
-
|
|
4518
|
+
const el = $(
|
|
4513
4519
|
'<my-component my-binding="aValue" your-binding="bValue" ></my-component>',
|
|
4514
4520
|
);
|
|
4515
4521
|
$compile(el)($rootScope);
|
|
@@ -4540,7 +4546,7 @@ describe("$compile", () => {
|
|
|
4540
4546
|
});
|
|
4541
4547
|
|
|
4542
4548
|
it("runs $onChanges for all components in the same digest", async () => {
|
|
4543
|
-
|
|
4549
|
+
const watchSpy = jasmine.createSpy();
|
|
4544
4550
|
myModule
|
|
4545
4551
|
.component("first", {
|
|
4546
4552
|
bindings: { myBinding: "<" },
|
|
@@ -4561,7 +4567,7 @@ describe("$compile", () => {
|
|
|
4561
4567
|
reloadModules();
|
|
4562
4568
|
|
|
4563
4569
|
$rootScope.aValue = 42;
|
|
4564
|
-
|
|
4570
|
+
const el = $(
|
|
4565
4571
|
"<div>" +
|
|
4566
4572
|
'<first my-binding="aValue"></first>' +
|
|
4567
4573
|
'<second my-binding="aValue"></second>' +
|
|
@@ -4590,8 +4596,7 @@ describe("$compile", () => {
|
|
|
4590
4596
|
expect($compileProvider.aHrefSanitizationTrustedUrlList()).toBe(
|
|
4591
4597
|
$$sanitizeUriProvider.aHrefSanitizationTrustedUrlList(),
|
|
4592
4598
|
);
|
|
4593
|
-
|
|
4594
|
-
expect(returnVal).toBe($compileProvider);
|
|
4599
|
+
$compileProvider.aHrefSanitizationTrustedUrlList(newRe);
|
|
4595
4600
|
expect($$sanitizeUriProvider.aHrefSanitizationTrustedUrlList()).toBe(
|
|
4596
4601
|
newRe,
|
|
4597
4602
|
);
|
|
@@ -4612,8 +4617,7 @@ describe("$compile", () => {
|
|
|
4612
4617
|
expect($compileProvider.imgSrcSanitizationTrustedUrlList()).toBe(
|
|
4613
4618
|
$$sanitizeUriProvider.imgSrcSanitizationTrustedUrlList(),
|
|
4614
4619
|
);
|
|
4615
|
-
|
|
4616
|
-
expect(returnVal).toBe($compileProvider);
|
|
4620
|
+
$compileProvider.imgSrcSanitizationTrustedUrlList(newRe);
|
|
4617
4621
|
expect($$sanitizeUriProvider.imgSrcSanitizationTrustedUrlList()).toBe(
|
|
4618
4622
|
newRe,
|
|
4619
4623
|
);
|
|
@@ -4637,14 +4641,13 @@ describe("$compile", () => {
|
|
|
4637
4641
|
|
|
4638
4642
|
it("should register a directive", () => {
|
|
4639
4643
|
myModule.directive("div", () => ({
|
|
4640
|
-
restrict: "EA",
|
|
4641
4644
|
link(scope, element) {
|
|
4642
4645
|
log = "OK";
|
|
4643
4646
|
element.innerText = "SUCCESS";
|
|
4644
4647
|
},
|
|
4645
4648
|
}));
|
|
4646
4649
|
reloadModules();
|
|
4647
|
-
|
|
4650
|
+
const el = $compile("<div></div>")($rootScope);
|
|
4648
4651
|
expect(el.innerText).toEqual("SUCCESS");
|
|
4649
4652
|
expect(log).toEqual("OK");
|
|
4650
4653
|
});
|
|
@@ -4652,14 +4655,12 @@ describe("$compile", () => {
|
|
|
4652
4655
|
it("should allow registration of multiple directives with same name", () => {
|
|
4653
4656
|
myModule
|
|
4654
4657
|
.directive("div", () => ({
|
|
4655
|
-
restrict: "EA",
|
|
4656
4658
|
link: {
|
|
4657
4659
|
pre: () => log.push("pre1"),
|
|
4658
4660
|
post: () => log.push("post1"),
|
|
4659
4661
|
},
|
|
4660
4662
|
}))
|
|
4661
4663
|
.directive("div", () => ({
|
|
4662
|
-
restrict: "EA",
|
|
4663
4664
|
link: {
|
|
4664
4665
|
pre: () => log.push("pre2"),
|
|
4665
4666
|
post: () => log.push("post2"),
|
|
@@ -5688,8 +5689,9 @@ describe("$compile", () => {
|
|
|
5688
5689
|
);
|
|
5689
5690
|
});
|
|
5690
5691
|
|
|
5691
|
-
it("should not load cross domain templates by default", () => {
|
|
5692
|
+
it("should not load cross domain templates by default", async () => {
|
|
5692
5693
|
$compile("<div cross-domain-template></div>")($rootScope);
|
|
5694
|
+
await wait();
|
|
5693
5695
|
expect(errors[0]).toMatch(/insecurl/);
|
|
5694
5696
|
});
|
|
5695
5697
|
|
|
@@ -7344,7 +7346,6 @@ describe("$compile", () => {
|
|
|
7344
7346
|
module = window.angular.module("test1", ["ng"]);
|
|
7345
7347
|
["a", "b", "c"].forEach((name) => {
|
|
7346
7348
|
module.directive(name, () => ({
|
|
7347
|
-
restrict: "EA",
|
|
7348
7349
|
compile() {
|
|
7349
7350
|
log.push(`t${name.toUpperCase()}`);
|
|
7350
7351
|
return {
|
|
@@ -7448,7 +7449,6 @@ describe("$compile", () => {
|
|
|
7448
7449
|
let value;
|
|
7449
7450
|
module.directive({
|
|
7450
7451
|
input: () => ({
|
|
7451
|
-
restrict: "EA",
|
|
7452
7452
|
link(scope, element, attr) {
|
|
7453
7453
|
value = attr.required;
|
|
7454
7454
|
},
|
|
@@ -7469,7 +7469,6 @@ describe("$compile", () => {
|
|
|
7469
7469
|
let value;
|
|
7470
7470
|
module.directive({
|
|
7471
7471
|
div: () => ({
|
|
7472
|
-
restrict: "EA",
|
|
7473
7472
|
link(scope, element, attr) {
|
|
7474
7473
|
value = attr.required;
|
|
7475
7474
|
},
|
|
@@ -7597,7 +7596,6 @@ describe("$compile", () => {
|
|
|
7597
7596
|
beforeEach(async () => {
|
|
7598
7597
|
["input", "a", "img"].forEach((tag) => {
|
|
7599
7598
|
module.directive(tag, () => ({
|
|
7600
|
-
restrict: "EA",
|
|
7601
7599
|
link(scope, element, attr) {
|
|
7602
7600
|
scope.$target.attr = attr;
|
|
7603
7601
|
},
|
|
@@ -7716,16 +7714,15 @@ describe("$compile", () => {
|
|
|
7716
7714
|
module
|
|
7717
7715
|
.directive("d1", () => ({
|
|
7718
7716
|
scope: true,
|
|
7719
|
-
|
|
7717
|
+
|
|
7720
7718
|
controller: TestController,
|
|
7721
7719
|
}))
|
|
7722
7720
|
.directive("d2", () => ({
|
|
7723
7721
|
scope: {},
|
|
7724
|
-
|
|
7722
|
+
|
|
7725
7723
|
controller: TestController,
|
|
7726
7724
|
}))
|
|
7727
7725
|
.directive("d3", () => ({
|
|
7728
|
-
restrict: "EA",
|
|
7729
7726
|
controller: TestController,
|
|
7730
7727
|
}));
|
|
7731
7728
|
|
|
@@ -10027,9 +10024,9 @@ describe("$compile", () => {
|
|
|
10027
10024
|
expect(onInitCalled).toBe(true);
|
|
10028
10025
|
});
|
|
10029
10026
|
|
|
10030
|
-
it("should eventually expose isolate scope variables on ES6 class controller with controllerAs when bindToController is true", () => {
|
|
10031
|
-
|
|
10032
|
-
|
|
10027
|
+
it("should eventually expose isolate scope variables on ES6 class controller with controllerAs when bindToController is true", async () => {
|
|
10028
|
+
let controllerCalled = false;
|
|
10029
|
+
const Controller = eval(
|
|
10033
10030
|
"(\n" +
|
|
10034
10031
|
"class Foo {\n" +
|
|
10035
10032
|
" constructor($scope) {}\n" +
|