@angular-wave/angular.ts 0.9.0 → 0.9.1

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.
Files changed (208) hide show
  1. package/@types/core/scope/scope.d.ts +1 -4
  2. package/@types/interface.d.ts +17 -3
  3. package/@types/shared/interface.d.ts +17 -0
  4. package/@types/shared/utils.d.ts +4 -19
  5. package/dist/angular-ts.esm.js +29 -152
  6. package/dist/angular-ts.umd.js +29 -152
  7. package/dist/angular-ts.umd.min.js +1 -1
  8. package/docs/layouts/shortcodes/version.html +1 -1
  9. package/docs/static/typedoc/assets/hierarchy.js +1 -1
  10. package/docs/static/typedoc/assets/main.js +2 -2
  11. package/docs/static/typedoc/assets/navigation.js +1 -1
  12. package/docs/static/typedoc/assets/search.js +1 -1
  13. package/docs/static/typedoc/classes/Location.html +20 -20
  14. package/docs/static/typedoc/classes/LocationProvider.html +5 -5
  15. package/docs/static/typedoc/classes/LogProvider.html +3 -3
  16. package/docs/static/typedoc/classes/PubSub.html +21 -21
  17. package/docs/static/typedoc/classes/PubSubProvider.html +1 -1
  18. package/docs/static/typedoc/classes/TemplateCacheProvider.html +2 -2
  19. package/docs/static/typedoc/hierarchy.html +1 -1
  20. package/docs/static/typedoc/index.html +1 -1
  21. package/docs/static/typedoc/interfaces/ChangesObject.html +3 -3
  22. package/docs/static/typedoc/interfaces/ComponentOptions.html +8 -8
  23. package/docs/static/typedoc/interfaces/Controller.html +6 -6
  24. package/docs/static/typedoc/interfaces/DefaultPorts.html +1 -1
  25. package/docs/static/typedoc/interfaces/Directive.html +18 -18
  26. package/docs/static/typedoc/interfaces/DirectivePrePost.html +1 -1
  27. package/docs/static/typedoc/interfaces/Html5Mode.html +1 -1
  28. package/docs/static/typedoc/interfaces/HttpProviderDefaults.html +7 -7
  29. package/docs/static/typedoc/interfaces/HttpService.html +21 -21
  30. package/docs/static/typedoc/interfaces/LogService.html +6 -6
  31. package/docs/static/typedoc/interfaces/NgModelController.html +15 -15
  32. package/docs/static/typedoc/interfaces/NgModelOptions.html +8 -8
  33. package/docs/static/typedoc/interfaces/Provider.html +17 -17
  34. package/docs/static/typedoc/interfaces/RequestConfig.html +15 -15
  35. package/docs/static/typedoc/interfaces/RequestShortcutConfig.html +11 -11
  36. package/docs/static/typedoc/interfaces/ServiceProvider.html +1 -1
  37. package/docs/static/typedoc/interfaces/TemplateCache.html +1 -1
  38. package/docs/static/typedoc/interfaces/TranscludeFunctionObject.html +4 -4
  39. package/docs/static/typedoc/interfaces/UrlParts.html +4 -4
  40. package/docs/static/typedoc/types/AnnotatedFactory.html +1 -1
  41. package/docs/static/typedoc/types/CloneAttachFunction.html +1 -1
  42. package/docs/static/typedoc/types/ControllerConstructor.html +1 -1
  43. package/docs/static/typedoc/types/DirectiveCompileFn.html +1 -1
  44. package/docs/static/typedoc/types/DirectiveController.html +1 -1
  45. package/docs/static/typedoc/types/DirectiveFactoryFn.html +1 -1
  46. package/docs/static/typedoc/types/DirectiveLinkFn.html +1 -1
  47. package/docs/static/typedoc/types/Expression.html +1 -1
  48. package/docs/static/typedoc/types/FilterFactory.html +1 -1
  49. package/docs/static/typedoc/types/FilterFn.html +1 -1
  50. package/docs/static/typedoc/types/Injectable.html +1 -1
  51. package/docs/static/typedoc/types/InjectableFactory.html +1 -1
  52. package/docs/static/typedoc/types/LogCall.html +1 -1
  53. package/docs/static/typedoc/types/LogServiceFactory.html +1 -1
  54. package/docs/static/typedoc/types/OnChangesObject.html +1 -1
  55. package/docs/static/typedoc/types/SwapModeType.html +1 -1
  56. package/docs/static/typedoc/types/TController.html +1 -1
  57. package/docs/static/typedoc/types/UrlChangeListener.html +4 -4
  58. package/docs/static/typedoc/variables/SwapMode.html +10 -10
  59. package/legacy.d.ts +0 -82
  60. package/package.json +2 -2
  61. package/src/animations/animate-js.js +2 -1
  62. package/src/animations/animate-queue.js +7 -6
  63. package/src/core/scope/scope.js +8 -10
  64. package/src/directive/http/form-router-test.html +44 -0
  65. package/src/directive/options/options-example.html +7 -3
  66. package/src/directive/options/options.js +1 -0
  67. package/src/directive/options/options.spec.js +117 -170
  68. package/src/interface.ts +20 -3
  69. package/src/router/directives/view-directive.js +0 -1
  70. package/src/router/resolve/resolve-context.js +0 -19
  71. package/src/router/state/state-registry.js +3 -10
  72. package/src/router/state/state-service.js +5 -5
  73. package/src/router/transition/transition.js +1 -86
  74. package/src/router/view-hook.spec.js +1 -1
  75. package/src/shared/interface.ts +19 -0
  76. package/src/shared/utils.js +3 -12
  77. package/tsconfig.types.json +2 -2
  78. package/@types/angular.d.ts +0 -150
  79. package/@types/animations/animate-cache.d.ts +0 -50
  80. package/@types/animations/animate-children-directive.d.ts +0 -10
  81. package/@types/animations/animate-css-driver.d.ts +0 -18
  82. package/@types/animations/animate-css.d.ts +0 -18
  83. package/@types/animations/animate-js-driver.d.ts +0 -14
  84. package/@types/animations/animate-js.d.ts +0 -23
  85. package/@types/animations/animate-queue.d.ts +0 -28
  86. package/@types/animations/animate-runner.d.ts +0 -31
  87. package/@types/animations/animate-swap.d.ts +0 -9
  88. package/@types/animations/animate.d.ts +0 -450
  89. package/@types/animations/animation.d.ts +0 -14
  90. package/@types/animations/interface.d.ts +0 -17
  91. package/@types/animations/raf-scheduler.d.ts +0 -37
  92. package/@types/animations/shared.d.ts +0 -74
  93. package/@types/core/compile/compile.d.ts +0 -201
  94. package/@types/core/controller/controller.d.ts +0 -54
  95. package/@types/core/di/injector.d.ts +0 -22
  96. package/@types/core/filter/filter.d.ts +0 -23
  97. package/@types/core/interpolate/interpolate.d.ts +0 -38
  98. package/@types/core/parse/ast/ast-node.d.ts +0 -56
  99. package/@types/core/parse/ast/ast.d.ts +0 -164
  100. package/@types/core/parse/lexer/lexer.d.ts +0 -119
  101. package/@types/core/parse/lexer/token.d.ts +0 -17
  102. package/@types/core/parse/parse.d.ts +0 -33
  103. package/@types/core/parse/parser/parser.d.ts +0 -41
  104. package/@types/core/sanitize/interface.d.ts +0 -10
  105. package/@types/core/sanitize/sanitize-uri.d.ts +0 -40
  106. package/@types/directive/aria/aria.d.ts +0 -104
  107. package/@types/directive/attrs/attrs.d.ts +0 -8
  108. package/@types/directive/bind/bind.d.ts +0 -18
  109. package/@types/directive/channel/channel.d.ts +0 -10
  110. package/@types/directive/class/class.d.ts +0 -3
  111. package/@types/directive/cloak/cloak.d.ts +0 -4
  112. package/@types/directive/controller/controller.d.ts +0 -4
  113. package/@types/directive/events/events.d.ts +0 -21
  114. package/@types/directive/form/form.d.ts +0 -264
  115. package/@types/directive/http/http.d.ts +0 -46
  116. package/@types/directive/if/if.d.ts +0 -10
  117. package/@types/directive/include/include.d.ts +0 -28
  118. package/@types/directive/init/init.d.ts +0 -4
  119. package/@types/directive/input/input.d.ts +0 -70
  120. package/@types/directive/messages/messages.d.ts +0 -63
  121. package/@types/directive/model/model.d.ts +0 -515
  122. package/@types/directive/model-options/model-options.d.ts +0 -56
  123. package/@types/directive/non-bindable/non-bindable.d.ts +0 -4
  124. package/@types/directive/observe/observe.d.ts +0 -9
  125. package/@types/directive/options/options.d.ts +0 -13
  126. package/@types/directive/ref/ref.d.ts +0 -11
  127. package/@types/directive/repeat/repeat.d.ts +0 -11
  128. package/@types/directive/script/script.d.ts +0 -10
  129. package/@types/directive/select/select.d.ts +0 -15
  130. package/@types/directive/setter/setter.d.ts +0 -12
  131. package/@types/directive/show-hide/show-hide.d.ts +0 -19
  132. package/@types/directive/style/style.d.ts +0 -4
  133. package/@types/directive/switch/switch.d.ts +0 -18
  134. package/@types/directive/transclude/transclude.d.ts +0 -10
  135. package/@types/directive/validators/validators.d.ts +0 -149
  136. package/@types/filters/filter.d.ts +0 -4
  137. package/@types/filters/filters.d.ts +0 -38
  138. package/@types/filters/limit-to.d.ts +0 -4
  139. package/@types/filters/order-by.d.ts +0 -7
  140. package/@types/index.d.ts +0 -2
  141. package/@types/ng.d.ts +0 -8
  142. package/@types/router/common/trace.d.ts +0 -66
  143. package/@types/router/directives/state-directives.d.ts +0 -46
  144. package/@types/router/directives/view-directive.d.ts +0 -138
  145. package/@types/router/glob/glob.d.ts +0 -81
  146. package/@types/router/hooks/core-resolvables.d.ts +0 -2
  147. package/@types/router/hooks/ignored-transition.d.ts +0 -1
  148. package/@types/router/hooks/invalid-transition.d.ts +0 -1
  149. package/@types/router/hooks/lazy-load.d.ts +0 -42
  150. package/@types/router/hooks/on-enter-exit-retain.d.ts +0 -3
  151. package/@types/router/hooks/redirect-to.d.ts +0 -4
  152. package/@types/router/hooks/resolve.d.ts +0 -4
  153. package/@types/router/hooks/update-globals.d.ts +0 -1
  154. package/@types/router/hooks/url.d.ts +0 -5
  155. package/@types/router/hooks/views.d.ts +0 -5
  156. package/@types/router/params/interface.d.ts +0 -606
  157. package/@types/router/params/param-factory.d.ts +0 -16
  158. package/@types/router/params/param-type.d.ts +0 -59
  159. package/@types/router/params/param-types.d.ts +0 -36
  160. package/@types/router/params/param.d.ts +0 -71
  161. package/@types/router/params/state-params.d.ts +0 -12
  162. package/@types/router/path/path-node.d.ts +0 -38
  163. package/@types/router/path/path-utils.d.ts +0 -88
  164. package/@types/router/resolve/interface.d.ts +0 -200
  165. package/@types/router/resolve/resolvable.d.ts +0 -50
  166. package/@types/router/resolve/resolve-context.d.ts +0 -102
  167. package/@types/router/router.d.ts +0 -47
  168. package/@types/router/state/interface.d.ts +0 -983
  169. package/@types/router/state/state-builder.d.ts +0 -95
  170. package/@types/router/state/state-matcher.d.ts +0 -7
  171. package/@types/router/state/state-object.d.ts +0 -83
  172. package/@types/router/state/state-queue-manager.d.ts +0 -29
  173. package/@types/router/state/state-registry.d.ts +0 -134
  174. package/@types/router/state/state-service.d.ts +0 -419
  175. package/@types/router/state/target-state.d.ts +0 -102
  176. package/@types/router/state/views.d.ts +0 -58
  177. package/@types/router/state-filters.d.ts +0 -39
  178. package/@types/router/template-factory.d.ts +0 -117
  179. package/@types/router/transition/hook-builder.d.ts +0 -45
  180. package/@types/router/transition/hook-registry.d.ts +0 -102
  181. package/@types/router/transition/interface.d.ts +0 -880
  182. package/@types/router/transition/reject-factory.d.ts +0 -43
  183. package/@types/router/transition/transition-event-type.d.ts +0 -24
  184. package/@types/router/transition/transition-hook.d.ts +0 -86
  185. package/@types/router/transition/transition-service.d.ts +0 -116
  186. package/@types/router/transition/transition.d.ts +0 -396
  187. package/@types/router/url/url-config.d.ts +0 -99
  188. package/@types/router/url/url-matcher.d.ts +0 -174
  189. package/@types/router/url/url-rule.d.ts +0 -161
  190. package/@types/router/url/url-rules.d.ts +0 -249
  191. package/@types/router/url/url-service.d.ts +0 -254
  192. package/@types/router/view/interface.d.ts +0 -44
  193. package/@types/router/view/view.d.ts +0 -149
  194. package/@types/router/view-scroll.d.ts +0 -10
  195. package/@types/services/anchor-scroll.d.ts +0 -25
  196. package/@types/services/cookie-reader.d.ts +0 -4
  197. package/@types/services/http/http.d.ts +0 -134
  198. package/@types/services/http-backend/http-backend.d.ts +0 -58
  199. package/@types/services/sce/sce.d.ts +0 -238
  200. package/@types/services/template-request.d.ts +0 -55
  201. package/@types/shared/common.d.ts +0 -197
  202. package/@types/shared/hof.d.ts +0 -108
  203. package/@types/shared/predicates.d.ts +0 -17
  204. package/@types/shared/queue.d.ts +0 -64
  205. package/@types/shared/strings.d.ts +0 -58
  206. package/@types/shared/test-utils.d.ts +0 -18
  207. package/docs/static/typedoc/classes/NgModule.html +0 -32
  208. package/src/router/params/README.md +0 -8
@@ -1,4 +0,0 @@
1
- /**
2
- * @returns {import('../../interface.ts').Directive}
3
- */
4
- export function ngInitDirective(): import("../../interface.ts").Directive;
@@ -1,70 +0,0 @@
1
- export function weekParser(isoWeek: any, existingDate: any): any;
2
- export function createDateParser(
3
- regexp: any,
4
- mapping: any,
5
- ): (iso: any, previousDate: any) => any;
6
- export function createDateInputType(
7
- type: any,
8
- regexp: any,
9
- parseDate: any,
10
- ): (
11
- scope: any,
12
- element: any,
13
- attr: any,
14
- ctrl: any,
15
- $filter: any,
16
- $parse: any,
17
- ) => void;
18
- export function badInputChecker(
19
- scope: any,
20
- element: any,
21
- attr: any,
22
- ctrl: any,
23
- parserName: any,
24
- ): void;
25
- export function numberFormatterParser(ctrl: any): void;
26
- export function isNumberInteger(num: any): boolean;
27
- export function countDecimals(num: any): number;
28
- export function isValidForStep(
29
- viewValue: any,
30
- stepBase: any,
31
- step: any,
32
- ): boolean;
33
- export function numberInputType(
34
- scope: any,
35
- element: any,
36
- attr: any,
37
- ctrl: any,
38
- $filter: any,
39
- $parse: any,
40
- ): void;
41
- export function rangeInputType(
42
- scope: any,
43
- element: any,
44
- attr: any,
45
- ctrl: any,
46
- ): void;
47
- /**
48
- * @param {*} $filter
49
- * @param {*} $parse
50
- * @returns {import('../../interface.ts').Directive}
51
- */
52
- export function inputDirective(
53
- $filter: any,
54
- $parse: any,
55
- ): import("../../interface.ts").Directive;
56
- export namespace inputDirective {
57
- let $inject: string[];
58
- }
59
- /**
60
- * @returns {import('../../interface.ts').Directive}
61
- */
62
- export function hiddenInputBrowserCacheDirective(): import("../../interface.ts").Directive;
63
- /**
64
- * @returns {import('../../interface.ts').Directive}
65
- */
66
- export function ngValueDirective(): import("../../interface.ts").Directive;
67
- export const ISO_DATE_REGEXP: RegExp;
68
- export const URL_REGEXP: RegExp;
69
- export const EMAIL_REGEXP: RegExp;
70
- export const VALIDITY_STATE_PROPERTY: "validity";
@@ -1,63 +0,0 @@
1
- export function ngMessagesDirective($animate: any): {
2
- require: string;
3
- restrict: string;
4
- controller: ($element: any, $scope: any, $attrs: any) => NgMessageCtrl;
5
- };
6
- export namespace ngMessagesDirective {
7
- let $inject: string[];
8
- }
9
- export function ngMessagesIncludeDirective(
10
- $templateRequest: any,
11
- $compile: any,
12
- ): {
13
- restrict: string;
14
- require: string;
15
- link($scope: any, element: any, attrs: any): void;
16
- };
17
- export namespace ngMessagesIncludeDirective {
18
- let $inject_1: string[];
19
- export { $inject_1 as $inject };
20
- }
21
- export const ngMessageDirective: (
22
- any: any,
23
- ) => import("../../interface.js").Directive;
24
- export const ngMessageExpDirective: (
25
- any: any,
26
- ) => import("../../interface.js").Directive;
27
- export const ngMessageDefaultDirective: (
28
- any: any,
29
- ) => import("../../interface.js").Directive;
30
- declare class NgMessageCtrl {
31
- /**
32
- * @param {Element} $element
33
- * @param {import('../../core/scope/scope.js').Scope} $scope
34
- * @param {import('../../core/compile/attributes').Attributes} $attrs
35
- * @param {*} $animate
36
- */
37
- constructor(
38
- $element: Element,
39
- $scope: import("../../core/scope/scope.js").Scope,
40
- $attrs: any,
41
- $animate: any,
42
- );
43
- $element: Element;
44
- $scope: import("../../core/scope/scope.js").Scope;
45
- $attrs: any;
46
- $animate: any;
47
- latestKey: number;
48
- nextAttachId: number;
49
- messages: {};
50
- renderLater: boolean;
51
- cachedCollection: {};
52
- head: any;
53
- default: any;
54
- getAttachId(): number;
55
- render(collection?: {}): void;
56
- reRender(): void;
57
- register(comment: any, messageCtrl: any, isDefault: any): void;
58
- deregister(comment: any, isDefault: any): void;
59
- findPreviousMessage(parent: any, comment: any): any;
60
- insertMessageNode(parent: any, comment: any, key: any): void;
61
- removeMessageNode(parent: any, comment: any, key: any): void;
62
- }
63
- export {};
@@ -1,515 +0,0 @@
1
- export function ngModelDirective(): {
2
- restrict: string;
3
- require: string[];
4
- controller: typeof NgModelController;
5
- priority: number;
6
- compile: (element: Element) => {
7
- pre: (scope: any, _element: any, attr: any, ctrls: any) => void;
8
- post: (scope: any, element: any, _attr: any, ctrls: any) => void;
9
- };
10
- };
11
- export const ngModelMinErr: (arg0: string, ...arg1: any[]) => Error;
12
- /**
13
- *
14
- * @property {*} $viewValue The actual value from the control's view.
15
- *
16
- * @property {*} $modelValue The value in the model that the control is bound to.
17
- * @property {Array.<Function>} $parsers Array of functions to execute, as a pipeline, whenever
18
- * the control updates the ngModelController with a new `$viewValue` from the DOM, usually via user input.
19
- *
20
- * @property {Array.<Function>} $formatters Array of functions to execute, as a pipeline, whenever
21
- the bound ngModel expression changes programmatically. The `$formatters` are not called when the
22
- value of the control is changed by user interaction.
23
- *
24
- * @property {Object.<string, (string, string) => boolean>} $validators A collection of validators that are applied whenever the model value changes.
25
- * The key value within the object refers to the name of the validator while the function refers to the validation operation.
26
- * The validation operation is provided with the model value as an argument and must return a true or false value depending on the response of that validation.
27
- *
28
- * @property {Object.<string, function(string, string) => Promise>} $asyncValidators A collection of validations that are expected to perform an asynchronous validation (e.g. a HTTP request).
29
- * The validation function that is provided is expected to return a promise when it is run during the model validation process
30
- *
31
- * @property {Array.<Function>} $viewChangeListeners Array of functions to execute whenever
32
- * a change to {@link ngModel.NgModelController#$viewValue `$viewValue`} has caused a change
33
- * to {@link ngModel.NgModelController#$modelValue `$modelValue`}.
34
- * It is called with no arguments, and its return value is ignored.
35
- * This can be used in place of additional $watches against the model value.
36
- *
37
- * @property {Object} $error An object hash with all failing validator ids as keys.
38
- * @property {Object} $pending An object hash with all pending validator ids as keys.
39
- *
40
- * @property {boolean} $untouched True if control has not lost focus yet.
41
- * @property {boolean} $touched True if control has lost focus.
42
- * @property {boolean} $pristine True if user has not interacted with the control yet.
43
- * @property {boolean} $dirty True if user has already interacted with the control.
44
- * @property {boolean} $valid True if there is no error.
45
- * @property {boolean} $invalid True if at least one error on the control.
46
- * @property {string} $name The name attribute of the control.
47
- */
48
- export class NgModelController {
49
- static $nonscope: boolean;
50
- static $inject: string[];
51
- /**
52
- * @param {import('../../core/scope/scope.js').Scope} $scope
53
- * @param {import('../../services/exception/exception-handler.js').ErrorHandler} $exceptionHandler
54
- * @param {import('../../core/compile/attributes.js').Attributes} $attr
55
- * @param {Element} $element
56
- * @param {import("../../core/parse/interface.ts").ParseService} $parse
57
- * @param {*} $animate
58
- * @param {*} $interpolate
59
- */
60
- constructor(
61
- $scope: import("../../core/scope/scope.js").Scope,
62
- $exceptionHandler: import("../../services/exception/exception-handler.js").ErrorHandler,
63
- $attr: import("../../core/compile/attributes.js").Attributes,
64
- $element: Element,
65
- $parse: import("../../core/parse/interface.ts").ParseService,
66
- $animate: any,
67
- $interpolate: any,
68
- );
69
- /** @type {any} The actual value from the control's view */
70
- $viewValue: any;
71
- /** @type {any} The value in the model that the control is bound to. */
72
- $modelValue: any;
73
- /** @type {any} */
74
- $$rawModelValue: any;
75
- $validators: {};
76
- $asyncValidators: {};
77
- $parsers: any[];
78
- $formatters: any[];
79
- $viewChangeListeners: any[];
80
- $untouched: boolean;
81
- /** @type {boolean} */
82
- $touched: boolean;
83
- /** @type {boolean} */
84
- $pristine: boolean;
85
- /** @type {boolean} */
86
- $dirty: boolean;
87
- /** @type {boolean} */
88
- $valid: boolean;
89
- /** @type {boolean} */
90
- $invalid: boolean;
91
- $error: {};
92
- $$success: {};
93
- $pending: any;
94
- $name: any;
95
- $$parentForm: {
96
- $nonscope: boolean;
97
- $addControl: Function;
98
- $getControls: () => any[];
99
- $$renameControl: Function;
100
- $removeControl: Function;
101
- $setValidity:
102
- | Function
103
- | ((key: any, isValid: boolean, control: any) => any);
104
- $setDirty: Function;
105
- $setPristine: Function;
106
- $setSubmitted: Function;
107
- $$setSubmitted: Function;
108
- };
109
- $options: {
110
- $$options: import("../model-options/model-options.js").ModelOptionsConfig;
111
- getOption(name: string):
112
- | string
113
- | boolean
114
- | number
115
- | {
116
- [x: string]: number;
117
- };
118
- createChild(options: ModelOptionsConfig): /*elided*/ any;
119
- };
120
- $$updateEvents: string;
121
- $$updateEventHandler(ev: any): void;
122
- $$parsedNgModel: import("../../core/parse/interface.ts").CompiledExpression;
123
- $$parsedNgModelAssign: (context: any, value: any) => any;
124
- /**
125
- * @type {import("../../core/parse/interface.ts").CompiledExpression |
126
- * (function(import("../../core/scope/scope.js").Scope): any)}
127
- */
128
- $$ngModelGet:
129
- | import("../../core/parse/interface.ts").CompiledExpression
130
- | ((arg0: import("../../core/scope/scope.js").Scope) => any);
131
- $$ngModelSet: (context: any, value: any) => any;
132
- $$pendingDebounce: number;
133
- $$parserValid: boolean;
134
- /** @type {string} */
135
- $$parserName: string;
136
- /** @type {number} */
137
- $$currentValidationRunId: number;
138
- /** @type {import('../../core/scope/scope.js').Scope} */
139
- $$scope: import("../../core/scope/scope.js").Scope;
140
- $$attr: import("../../core/compile/attributes.js").Attributes;
141
- $$element: Element;
142
- $$animate: any;
143
- $$parse: import("../../core/parse/interface.ts").ParseService;
144
- $$exceptionHandler: import("../../services/exception/interface.ts").Interface;
145
- $$hasNativeValidators: boolean;
146
- $$classCache: {};
147
- $$eventRemovers: Set<any>;
148
- set(object: any, property: any): void;
149
- unset(object: any, property: any): void;
150
- $setValidity(validationErrorKey: any, state: any): void;
151
- $$initGetterSetters(): void;
152
- /**
153
- * Called when the view needs to be updated. It is expected that the user of the ng-model
154
- * directive will implement this method.
155
- *
156
- * The `$render()` method is invoked in the following situations:
157
- *
158
- * * `$rollbackViewValue()` is called. If we are rolling back the view value to the last
159
- * committed value then `$render()` is called to update the input control.
160
- * * The value referenced by `ng-model` is changed programmatically and both the `$modelValue` and
161
- * the `$viewValue` are different from last time.
162
- *
163
- * Since `ng-model` does not do a deep watch, `$render()` is only invoked if the values of
164
- * `$modelValue` and `$viewValue` are actually different from their previous values. If `$modelValue`
165
- * or `$viewValue` are objects (rather than a string or number) then `$render()` will not be
166
- * invoked if you only change a property on the objects.
167
- */
168
- $render(): void;
169
- /**
170
- * This is called when we need to determine if the value of an input is empty.
171
- *
172
- * For instance, the required directive does this to work out if the input has data or not.
173
- *
174
- * The default `$isEmpty` function checks whether the value is `undefined`, `''`, `null` or `NaN`.
175
- *
176
- * You can override this for input directives whose concept of being empty is different from the
177
- * default. The `checkboxInputType` directive does this because in its case a value of `false`
178
- * implies empty.
179
- *
180
- * @param {*} value The value of the input to check for emptiness.
181
- * @returns {boolean} True if `value` is "empty".
182
- */
183
- $isEmpty(value: any): boolean;
184
- $$updateEmptyClasses(value: any): void;
185
- /**
186
- * Sets the control to its pristine state.
187
- *
188
- * This method can be called to remove the `ng-dirty` class and set the control to its pristine
189
- * state (`ng-pristine` class). A model is considered to be pristine when the control
190
- * has not been changed from when first compiled.
191
- */
192
- $setPristine(): void;
193
- /**
194
- * Sets the control to its dirty state.
195
- *
196
- * This method can be called to remove the `ng-pristine` class and set the control to its dirty
197
- * state (`ng-dirty` class). A model is considered to be dirty when the control has been changed
198
- * from when first compiled.
199
- */
200
- $setDirty(): void;
201
- /**
202
- * Sets the control to its untouched state.
203
- *
204
- * This method can be called to remove the `ng-touched` class and set the control to its
205
- * untouched state (`ng-untouched` class). Upon compilation, a model is set as untouched
206
- * by default, however this function can be used to restore that state if the model has
207
- * already been touched by the user.
208
- */
209
- $setUntouched(): void;
210
- /**
211
- * Sets the control to its touched state.
212
- *
213
- * This method can be called to remove the `ng-untouched` class and set the control to its
214
- * touched state (`ng-touched` class). A model is considered to be touched when the user has
215
- * first focused the control element and then shifted focus away from the control (blur event).
216
- */
217
- $setTouched(): void;
218
- /**
219
- * Cancel an update and reset the input element's value to prevent an update to the `$modelValue`,
220
- * which may be caused by a pending debounced event or because the input is waiting for some
221
- * future event.
222
- *
223
- * If you have an input that uses `ng-model-options` to set up debounced updates or updates that
224
- * depend on special events such as `blur`, there can be a period when the `$viewValue` is out of
225
- * sync with the ngModel's `$modelValue`.
226
- *
227
- * In this case, you can use `$rollbackViewValue()` to manually cancel the debounced / future update
228
- * and reset the input to the last committed view value.
229
- *
230
- * It is also possible that you run into difficulties if you try to update the ngModel's `$modelValue`
231
- * programmatically before these debounced/future events have resolved/occurred, because AngularTS's
232
- * dirty checking mechanism is not able to tell whether the model has actually changed or not.
233
- *
234
- * The `$rollbackViewValue()` method should be called before programmatically changing the model of an
235
- * input which may have such events pending. This is important in order to make sure that the
236
- * input field will be updated with the new model value and any pending operations are cancelled.
237
- *
238
- * @example
239
- * <example name="ng-model-cancel-update" module="cancel-update-example">
240
- * <file name="app.js">
241
- * angular.module('cancel-update-example', [])
242
- *
243
- * .controller('CancelUpdateController', ['$scope', function($scope) {
244
- * $scope.model = {value1: '', value2: ''};
245
- *
246
- * $scope.setEmpty = function(e, value, rollback) {
247
- * if (e.keyCode === 27) {
248
- * e.preventDefault();
249
- * if (rollback) {
250
- * $scope.myForm[value].$rollbackViewValue();
251
- * }
252
- * $scope.model[value] = '';
253
- * }
254
- * };
255
- * }]);
256
- * </file>
257
- * <file name="index.html">
258
- * <div ng-controller="CancelUpdateController">
259
- * <p>Both of these inputs are only updated if they are blurred. Hitting escape should
260
- * empty them. Follow these steps and observe the difference:</p>
261
- * <ol>
262
- * <li>Type something in the input. You will see that the model is not yet updated</li>
263
- * <li>Press the Escape key.
264
- * <ol>
265
- * <li> In the first example, nothing happens, because the model is already '', and no
266
- * update is detected. If you blur the input, the model will be set to the current view.
267
- * </li>
268
- * <li> In the second example, the pending update is cancelled, and the input is set back
269
- * to the last committed view value (''). Blurring the input does nothing.
270
- * </li>
271
- * </ol>
272
- * </li>
273
- * </ol>
274
- *
275
- * <form name="myForm" ng-model-options="{ updateOn: 'blur' }">
276
- * <div>
277
- * <p id="inputDescription1">Without $rollbackViewValue():</p>
278
- * <input name="value1" aria-describedby="inputDescription1" ng-model="model.value1"
279
- * ng-keydown="setEmpty($event, 'value1')">
280
- * value1: "{{ model.value1 }}"
281
- * </div>
282
- *
283
- * <div>
284
- * <p id="inputDescription2">With $rollbackViewValue():</p>
285
- * <input name="value2" aria-describedby="inputDescription2" ng-model="model.value2"
286
- * ng-keydown="setEmpty($event, 'value2', true)">
287
- * value2: "{{ model.value2 }}"
288
- * </div>
289
- * </form>
290
- * </div>
291
- * </file>
292
- <file name="style.css">
293
- div {
294
- display: table-cell;
295
- }
296
- div:nth-child(1) {
297
- padding-right: 30px;
298
- }
299
-
300
- </file>
301
- * </example>
302
- */
303
- $rollbackViewValue(): void;
304
- /**
305
- * Runs each of the registered validators (first synchronous validators and then
306
- * asynchronous validators).
307
- * If the validity changes to invalid, the model will be set to `undefined`,
308
- * unless {@link ngModelOptions `ngModelOptions.allowInvalid`} is `true`.
309
- * If the validity changes to valid, it will set the model to the last available valid
310
- * `$modelValue`, i.e. either the last parsed value or the last value set from the scope.
311
- */
312
- $validate(): void;
313
- $$runValidators(modelValue: any, viewValue: any, doneCallback: any): void;
314
- /**
315
- * Commit a pending update to the `$modelValue`.
316
- *
317
- * Updates may be pending by a debounced event or because the input is waiting for a some future
318
- * event defined in `ng-model-options`. this method is rarely needed as `NgModelController`
319
- * usually handles calling this in response to input events.
320
- */
321
- $commitViewValue(): void;
322
- $$lastCommittedViewValue: any;
323
- $$parseAndValidate(): void;
324
- $$writeModelToScope(): void;
325
- /**
326
- * Update the view value.
327
- *
328
- * This method should be called when a control wants to change the view value; typically,
329
- * this is done from within a DOM event handler. For example, the {@link ng.directive:input input}
330
- * directive calls it when the value of the input changes and {@link ng.directive:select select}
331
- * calls it when an option is selected.
332
- *
333
- * When `$setViewValue` is called, the new `value` will be staged for committing through the `$parsers`
334
- * and `$validators` pipelines. If there are no special {@link ngModelOptions} specified then the staged
335
- * value is sent directly for processing through the `$parsers` pipeline. After this, the `$validators` and
336
- * `$asyncValidators` are called and the value is applied to `$modelValue`.
337
- * Finally, the value is set to the **expression** specified in the `ng-model` attribute and
338
- * all the registered change listeners, in the `$viewChangeListeners` list are called.
339
- *
340
- * In case the {@link ng.directive:ngModelOptions ngModelOptions} directive is used with `updateOn`
341
- * and the `default` trigger is not listed, all those actions will remain pending until one of the
342
- * `updateOn` events is triggered on the DOM element.
343
- * All these actions will be debounced if the {@link ng.directive:ngModelOptions ngModelOptions}
344
- * directive is used with a custom debounce for this particular event.
345
- * Note that a `$digest` is only triggered once the `updateOn` events are fired, or if `debounce`
346
- * is specified, once the timer runs out.
347
- *
348
- * When used with standard inputs, the view value will always be a string (which is in some cases
349
- * parsed into another type, such as a `Date` object for `input[date]`.)
350
- * However, custom controls might also pass objects to this method. In this case, we should make
351
- * a copy of the object before passing it to `$setViewValue`. This is because `ngModel` does not
352
- * perform a deep watch of objects, it only looks for a change of identity. If you only change
353
- * the property of the object then ngModel will not realize that the object has changed and
354
- * will not invoke the `$parsers` and `$validators` pipelines. For this reason, you should
355
- * not change properties of the copy once it has been passed to `$setViewValue`.
356
- * Otherwise you may cause the model value on the scope to change incorrectly.
357
- *
358
- * <div class="alert alert-info">
359
- * In any case, the value passed to the method should always reflect the current value
360
- * of the control. For example, if you are calling `$setViewValue` for an input element,
361
- * you should pass the input DOM value. Otherwise, the control and the scope model become
362
- * out of sync. It's also important to note that `$setViewValue` does not call `$render` or change
363
- * the control's DOM value in any way. If we want to change the control's DOM value
364
- * programmatically, we should update the `ngModel` scope expression. Its new value will be
365
- * picked up by the model controller, which will run it through the `$formatters`, `$render` it
366
- * to update the DOM, and finally call `$validate` on it.
367
- * </div>
368
- *
369
- * @param {*} value value from the view.
370
- * @param {string} [trigger] Event that triggered the update.
371
- */
372
- $setViewValue(value: any, trigger?: string): void;
373
- $$debounceViewValueCommit(trigger: any): void;
374
- /**
375
- *
376
- * Override the current model options settings programmatically.
377
- *
378
- * The previous `ModelOptions` value will not be modified. Instead, a
379
- * new `ModelOptions` object will inherit from the previous one overriding
380
- * or inheriting settings that are defined in the given parameter.
381
- *
382
- * See {@link ngModelOptions} for information about what options can be specified
383
- * and how model option inheritance works.
384
- *
385
- * <div class="alert alert-warning">
386
- * **Note:** this function only affects the options set on the `ngModelController`,
387
- * and not the options on the {@link ngModelOptions} directive from which they might have been
388
- * obtained initially.
389
- * </div>
390
- *
391
- * <div class="alert alert-danger">
392
- * **Note:** it is not possible to override the `getterSetter` option.
393
- * </div>
394
- *
395
- * @param {Object} options a hash of settings to override the previous options
396
- *
397
- */
398
- $overrideModelOptions(options: any): void;
399
- /**
400
- * Runs the model -> view pipeline on the current
401
- * {@link ngModel.NgModelController#$modelValue $modelValue}.
402
- *
403
- * The following actions are performed by this method:
404
- *
405
- * - the `$modelValue` is run through the {@link ngModel.NgModelController#$formatters $formatters}
406
- * and the result is set to the {@link ngModel.NgModelController#$viewValue $viewValue}
407
- * - the `ng-empty` or `ng-not-empty` class is set on the element
408
- * - if the `$viewValue` has changed:
409
- * - {@link ngModel.NgModelController#$render $render} is called on the control
410
- * - the {@link ngModel.NgModelController#$validators $validators} are run and
411
- * the validation status is set.
412
- *
413
- * This method is called by ngModel internally when the bound scope value changes.
414
- * Application developers usually do not have to call this function themselves.
415
- *
416
- * This function can be used when the `$viewValue` or the rendered DOM value are not correctly
417
- * formatted and the `$modelValue` must be run through the `$formatters` again.
418
- *
419
- * @example
420
- * Consider a text input with an autocomplete list (for fruit), where the items are
421
- * objects with a name and an id.
422
- * A user enters `ap` and then selects `Apricot` from the list.
423
- * Based on this, the autocomplete widget will call `$setViewValue({name: 'Apricot', id: 443})`,
424
- * but the rendered value will still be `ap`.
425
- * The widget can then call `ctrl.$processModelValue()` to run the model -> view
426
- * pipeline again, which formats the object to the string `Apricot`,
427
- * then updates the `$viewValue`, and finally renders it in the DOM.
428
- *
429
- * <example module="inputExample" name="ng-model-process">
430
- <file name="index.html">
431
- <div ng-controller="inputController" style="display: flex;">
432
- <div style="margin-right: 30px;">
433
- Search Fruit:
434
- <basic-autocomplete items="items" on-select="selectedFruit = item"></basic-autocomplete>
435
- </div>
436
- <div>
437
- Model:<br>
438
- <pre>{{selectedFruit | json}}</pre>
439
- </div>
440
- </div>
441
- </file>
442
- <file name="app.js">
443
- angular.module('inputExample', [])
444
- .controller('inputController', function($scope) {
445
- $scope.items = [
446
- {name: 'Apricot', id: 443},
447
- {name: 'Clementine', id: 972},
448
- {name: 'Durian', id: 169},
449
- {name: 'Jackfruit', id: 982},
450
- {name: 'Strawberry', id: 863}
451
- ];
452
- })
453
- .component('basicAutocomplete', {
454
- bindings: {
455
- items: '<',
456
- onSelect: '&'
457
- },
458
- templateUrl: 'autocomplete.html',
459
- controller: function($element, $scope) {
460
- let that = this;
461
- let ngModel;
462
-
463
- that.$postLink = function() {
464
- ngModel = $element.querySelectorAll('input').controller('ngModel');
465
-
466
- ngModel.$formatters.push(function(value) {
467
- return (value && value.name) || value;
468
- });
469
-
470
- ngModel.$parsers.push(function(value) {
471
- let match = value;
472
- for (let i = 0; i < that.items.length; i++) {
473
- if (that.items[i].name === value) {
474
- match = that.items[i];
475
- break;
476
- }
477
- }
478
-
479
- return match;
480
- });
481
- };
482
-
483
- that.selectItem = function(item) {
484
- ngModel.$setViewValue(item);
485
- ngModel.$processModelValue();
486
- that.onSelect({item: item});
487
- };
488
- }
489
- });
490
- </file>
491
- <file name="autocomplete.html">
492
- <div>
493
- <input type="search" ng-model="$ctrl.searchTerm" />
494
- <ul>
495
- <li ng-repeat="item in $ctrl.items | filter:$ctrl.searchTerm">
496
- <button ng-click="$ctrl.selectItem(item)">{{ item.name }}</button>
497
- </li>
498
- </ul>
499
- </div>
500
- </file>
501
- * </example>
502
- *
503
- */
504
- $processModelValue(): void;
505
- /**
506
- * This method is called internally to run the $formatters on the $modelValue
507
- */
508
- $$format(): any;
509
- /**
510
- * This method is called internally when the bound scope value changes.
511
- */
512
- $$setModelValue(modelValue: any): void;
513
- $$removeAllEventListeners(): void;
514
- $$setUpdateOnEvents(): void;
515
- }