@angular-wave/angular.ts 0.7.8 → 0.8.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 (308) hide show
  1. package/@types/{loader.d.ts → angular.d.ts} +3 -3
  2. package/@types/core/di/ng-module.d.ts +61 -25
  3. package/@types/core/parse/parse.d.ts +6 -7
  4. package/@types/directive/bind/bind.d.ts +2 -1
  5. package/@types/index.d.ts +1 -1
  6. package/@types/interface.d.ts +4 -2
  7. package/@types/{public.d.ts → ng.d.ts} +2 -2
  8. package/@types/router/directives/state-directives.d.ts +2 -2
  9. package/@types/router/directives/view-directive.d.ts +1 -1
  10. package/@types/router/params/param-type.d.ts +0 -1
  11. package/@types/router/path/path-utils.d.ts +8 -11
  12. package/@types/router/{globals.d.ts → router.d.ts} +2 -2
  13. package/@types/router/state/interface.d.ts +1 -1
  14. package/@types/router/state/state-object.d.ts +1 -1
  15. package/@types/router/state/state-registry.d.ts +2 -2
  16. package/@types/router/state/state-service.d.ts +14 -16
  17. package/@types/router/state-filters.d.ts +24 -2
  18. package/@types/router/transition/transition-service.d.ts +3 -3
  19. package/@types/router/transition/transition.d.ts +16 -19
  20. package/@types/router/url/url-matcher.d.ts +3 -4
  21. package/@types/router/url/url-rule.d.ts +14 -4
  22. package/@types/router/url/url-rules.d.ts +26 -6
  23. package/@types/router/url/url-service.d.ts +28 -38
  24. package/@types/services/http/http.d.ts +48 -1
  25. package/@types/services/http-backend/http-backend.d.ts +48 -35
  26. package/@types/services/location/interface.d.ts +55 -0
  27. package/@types/services/location/location.d.ts +225 -252
  28. package/@types/shared/common.d.ts +0 -2
  29. package/@types/shared/hof.d.ts +0 -6
  30. package/@types/shared/interface.d.ts +0 -4
  31. package/@types/{router/common → shared}/queue.d.ts +2 -2
  32. package/@types/shared/url-utils/interface.d.ts +0 -1
  33. package/@types/shared/url-utils/url-utils.d.ts +0 -5
  34. package/@types/shared/utils.d.ts +29 -6
  35. package/CHANGELOG.md +0 -72
  36. package/CONTRIBUTING.md +0 -1
  37. package/DEVELOPERS.md +0 -1
  38. package/Makefile +6 -3
  39. package/TRIAGING.md +0 -1
  40. package/dist/angular-ts.esm.js +1048 -1150
  41. package/dist/angular-ts.umd.js +1048 -1150
  42. package/dist/angular-ts.umd.min.js +1 -1
  43. package/docs/assets/scss/index.scss +23 -0
  44. package/docs/content/_index.md +9 -8
  45. package/docs/content/docs/_index.md +1 -1
  46. package/docs/content/docs/directive/app.md +1 -1
  47. package/docs/content/docs/directive/bind.md +1 -1
  48. package/docs/content/docs/directive/blur.md +1 -1
  49. package/docs/content/docs/directive/channel.md +2 -2
  50. package/docs/content/docs/directive/class-even.md +1 -1
  51. package/docs/content/docs/directive/class-odd.md +1 -1
  52. package/docs/content/docs/directive/class.md +1 -1
  53. package/docs/content/docs/directive/click.md +1 -1
  54. package/docs/content/docs/directive/copy.md +1 -1
  55. package/docs/content/docs/directive/cut.md +1 -1
  56. package/docs/content/docs/directive/dblclick.md +1 -1
  57. package/docs/content/docs/directive/focus.md +1 -1
  58. package/docs/content/docs/directive/get.md +3 -3
  59. package/docs/content/docs/directive/keydown.md +1 -1
  60. package/docs/content/docs/directive/keyup.md +1 -1
  61. package/docs/content/docs/directive/load.md +1 -1
  62. package/docs/content/docs/directive/mousedown.md +1 -1
  63. package/docs/content/docs/directive/mouseenter.md +1 -1
  64. package/docs/content/docs/directive/mouseleave.md +1 -1
  65. package/docs/content/docs/directive/mousemove.md +1 -1
  66. package/docs/content/docs/directive/mouseout.md +1 -1
  67. package/docs/content/docs/directive/mouseover.md +1 -1
  68. package/docs/content/docs/directive/mouseup.md +1 -1
  69. package/docs/content/docs/directive/non-bindable.md +28 -0
  70. package/docs/content/docs/provider/locationProvider.md +26 -0
  71. package/docs/content/docs/provider/templateCacheProvider.md +2 -2
  72. package/docs/content/docs/service/location.md +57 -0
  73. package/docs/content/docs/service/url.md +5 -0
  74. package/docs/layouts/partials/hooks/head-end.html +1 -1
  75. package/docs/layouts/shortcodes/version.html +1 -0
  76. package/docs/static/examples/counter/counter-test.html +0 -4
  77. package/docs/static/examples/eventbus/eventbus-test.html +0 -4
  78. package/docs/static/examples/ng-non-bindable/ng-non-bindable-test.html +13 -0
  79. package/docs/static/examples/ng-non-bindable/ng-non-bindable.html +3 -0
  80. package/docs/static/examples/ng-non-bindable/ng-non-bindable.test.js +11 -0
  81. package/docs/static/typedoc/assets/hierarchy.js +1 -1
  82. package/docs/static/typedoc/assets/highlight.css +6 -6
  83. package/docs/static/typedoc/assets/navigation.js +1 -1
  84. package/docs/static/typedoc/assets/search.js +1 -1
  85. package/docs/static/typedoc/classes/Location.html +55 -0
  86. package/docs/static/typedoc/classes/LocationProvider.html +20 -0
  87. package/docs/static/typedoc/classes/NgModule.html +3 -3
  88. package/docs/static/typedoc/index.html +1 -1
  89. package/docs/static/typedoc/interfaces/DefaultPorts.html +5 -0
  90. package/docs/static/typedoc/interfaces/Html5Mode.html +23 -0
  91. package/docs/static/typedoc/interfaces/Provider.html +2 -1
  92. package/docs/static/typedoc/interfaces/UrlParts.html +9 -0
  93. package/docs/static/typedoc/types/AnnotatedFactory.html +1 -1
  94. package/docs/static/typedoc/types/Expression.html +1 -1
  95. package/docs/static/typedoc/types/Injectable.html +4 -1
  96. package/docs/static/typedoc/types/InjectableFactory.html +1 -4
  97. package/docs/static/typedoc/types/UrlChangeListener.html +5 -0
  98. package/docs/static/version.js +13 -0
  99. package/docs/test-results/.last-run.json +4 -0
  100. package/docs/test-results/static-examples-counter-counter-counter-example/error-context.md +50 -0
  101. package/package.json +2 -2
  102. package/src/{loader.js → angular.js} +11 -11
  103. package/src/angular.spec.js +189 -21
  104. package/src/animations/animate-css.js +17 -18
  105. package/src/animations/animate.spec.js +1 -1
  106. package/src/animations/shared.js +2 -3
  107. package/src/binding.spec.js +1 -1
  108. package/src/core/compile/compile.js +4 -7
  109. package/src/core/compile/compile.spec.js +1 -1
  110. package/src/core/controller/controller.spec.js +1 -1
  111. package/src/core/controller/controller.test.js +1 -0
  112. package/src/core/di/injector.js +7 -8
  113. package/src/core/di/injector.spec.js +2 -2
  114. package/src/core/di/injector.test.js +2 -2
  115. package/src/core/di/internal-injector.js +3 -6
  116. package/src/core/di/ng-module.js +26 -21
  117. package/src/core/filter/filter.js +1 -1
  118. package/src/core/filter/filter.spec.js +1 -1
  119. package/src/core/filter/filter.test.js +1 -0
  120. package/src/core/interpolate/interpolate.js +4 -6
  121. package/src/core/interpolate/interpolate.spec.js +1 -1
  122. package/src/core/interpolate/interpolate.test.js +1 -0
  123. package/src/core/parse/ast/ast.spec.js +1 -1
  124. package/src/core/parse/ast/ast.test.js +1 -1
  125. package/src/core/parse/lexer/lexer.spec.js +1 -1
  126. package/src/core/parse/parse.js +150 -146
  127. package/src/core/parse/parse.spec.js +46 -46
  128. package/src/core/prop.spec.js +1 -1
  129. package/src/core/root-element.spec.js +1 -1
  130. package/src/core/scope/scope.js +10 -11
  131. package/src/core/scope/scope.spec.js +3 -4
  132. package/src/directive/aria/aria.spec.js +1 -1
  133. package/src/directive/aria/aria.test.js +1 -0
  134. package/src/directive/attrs/attrs.spec.js +1 -1
  135. package/src/directive/attrs/attrs.test.js +1 -0
  136. package/src/directive/attrs/boolean.spec.js +1 -1
  137. package/src/directive/attrs/boolean.test.js +1 -0
  138. package/src/directive/attrs/element-style.spec.js +1 -1
  139. package/src/directive/attrs/element-style.test.js +1 -0
  140. package/src/directive/attrs/src.spec.js +1 -1
  141. package/src/directive/attrs/src.test.js +1 -0
  142. package/src/directive/bind/bind-html.spec.js +1 -1
  143. package/src/directive/bind/bind.js +1 -0
  144. package/src/directive/bind/bind.spec.js +1 -1
  145. package/src/directive/bind/bind.test.js +1 -0
  146. package/src/directive/channel/channel.spec.js +1 -1
  147. package/src/directive/channel/channel.test.js +1 -0
  148. package/src/directive/class/class.spec.js +1 -1
  149. package/src/directive/class/class.test.js +1 -0
  150. package/src/directive/cloak/cloak.spec.js +1 -1
  151. package/src/directive/cloak/cloak.test.js +1 -0
  152. package/src/directive/controller/controller.spec.js +1 -1
  153. package/src/directive/controller/controller.test.js +1 -0
  154. package/src/directive/events/click.spec.js +1 -1
  155. package/src/directive/events/event.spec.js +6 -6
  156. package/src/directive/events/events.test.js +1 -0
  157. package/src/directive/form/form.js +8 -5
  158. package/src/directive/form/form.spec.js +1 -1
  159. package/src/directive/form/form.test.js +1 -0
  160. package/src/directive/http/delete.spec.js +1 -1
  161. package/src/directive/http/form-test.html +18 -0
  162. package/src/directive/http/get.spec.js +1 -1
  163. package/src/directive/http/http.js +12 -3
  164. package/src/directive/http/post.spec.js +504 -9
  165. package/src/directive/http/put.spec.js +1 -1
  166. package/src/directive/if/if.spec.js +1 -1
  167. package/src/directive/include/include.spec.js +1 -1
  168. package/src/directive/init/init.spec.js +1 -1
  169. package/src/directive/init/init.test.js +1 -0
  170. package/src/directive/input/input.js +13 -15
  171. package/src/directive/input/input.spec.js +1 -2
  172. package/src/directive/input/input.test.js +1 -0
  173. package/src/directive/messages/messages.md +0 -4
  174. package/src/directive/messages/messages.spec.js +1 -1
  175. package/src/directive/messages/messages.test.js +1 -0
  176. package/src/directive/model/model.js +13 -13
  177. package/src/directive/model/model.spec.js +1 -1
  178. package/src/directive/model/model.test.js +1 -0
  179. package/src/directive/model-options/model-option.test.js +1 -0
  180. package/src/directive/model-options/model-options.js +1 -1
  181. package/src/directive/model-options/model-options.spec.js +1 -1
  182. package/src/directive/non-bindable/non-bindable.spec.js +1 -1
  183. package/src/directive/non-bindable/non-bindable.test.js +1 -0
  184. package/src/directive/observe/observe.spec.js +1 -1
  185. package/src/directive/observe/observe.test.js +1 -0
  186. package/src/directive/on/on.spec.js +1 -1
  187. package/src/directive/on/on.test.js +1 -0
  188. package/src/directive/options/options.spec.js +1 -1
  189. package/src/directive/options/options.test.js +1 -0
  190. package/src/directive/ref/href.spec.js +1 -1
  191. package/src/directive/ref/href.test.js +2 -0
  192. package/src/directive/ref/ref.spec.js +1 -1
  193. package/src/directive/repeat/repeat.js +1 -1
  194. package/src/directive/repeat/repeat.spec.js +2 -3
  195. package/src/directive/repeat/repeat.test.js +1 -0
  196. package/src/directive/script/script.spec.js +1 -1
  197. package/src/directive/script/script.test.js +1 -0
  198. package/src/directive/select/select.js +1 -1
  199. package/src/directive/select/select.spec.js +1 -1
  200. package/src/directive/select/select.test.js +1 -0
  201. package/src/directive/setter/setter.spec.js +1 -1
  202. package/src/directive/setter/setter.test.js +1 -0
  203. package/src/directive/show-hide/show-hide.spec.js +1 -1
  204. package/src/directive/show-hide/show-hide.test.js +1 -0
  205. package/src/directive/style/style.spec.js +1 -1
  206. package/src/directive/style/style.test.js +1 -0
  207. package/src/directive/switch/switch.spec.js +1 -1
  208. package/src/directive/switch/switch.test.js +1 -0
  209. package/src/directive/validators/validators.js +82 -84
  210. package/src/directive/validators/validators.spec.js +5 -4
  211. package/src/directive/validators/validators.test.js +1 -0
  212. package/src/filters/filter.spec.js +1 -1
  213. package/src/filters/filters.spec.js +1 -1
  214. package/src/filters/limit-to.js +2 -3
  215. package/src/filters/limit-to.spec.js +1 -1
  216. package/src/filters/order-by.spec.js +1 -1
  217. package/src/index.js +1 -1
  218. package/src/injection-tokens.js +7 -3
  219. package/src/interface.ts +4 -3
  220. package/src/loader.md +0 -155
  221. package/src/{public.js → ng.js} +11 -12
  222. package/src/{public.spec.js → ng.spec.js} +2 -2
  223. package/src/router/directives/state-directives.js +5 -5
  224. package/src/router/directives/state-directives.spec.js +8 -7
  225. package/src/router/directives/view-directive.js +7 -13
  226. package/src/router/directives/view-directive.spec.js +22 -23
  227. package/src/router/{common/common.html → glob/glob.html} +2 -3
  228. package/src/router/{common/common.test.js → glob/glob.test.js} +2 -1
  229. package/src/router/params/param-type.js +0 -1
  230. package/src/router/params/param.js +1 -1
  231. package/src/router/path/path-utils.js +5 -0
  232. package/src/router/router-test-hashbang.html +45 -0
  233. package/src/router/{globals.js → router.js} +2 -2
  234. package/src/router/services.spec.js +8 -9
  235. package/src/router/state/interface.ts +1 -1
  236. package/src/router/state/state-builder.js +3 -3
  237. package/src/router/state/state-builder.spec.js +1 -1
  238. package/src/router/state/state-object.js +1 -1
  239. package/src/router/state/state-registry.js +4 -4
  240. package/src/router/state/state-service.js +14 -14
  241. package/src/router/state/state.spec.js +23 -22
  242. package/src/router/state/state.test.js +1 -0
  243. package/src/router/state/views.js +1 -1
  244. package/src/router/state-filter.spec.js +1 -1
  245. package/src/router/state-filters.js +13 -9
  246. package/src/router/template-factory.js +5 -4
  247. package/src/router/template-factory.spec.js +7 -7
  248. package/src/router/transition/hook-registry.js +1 -1
  249. package/src/router/transition/transition-service.js +7 -6
  250. package/src/router/transition/transition.js +6 -6
  251. package/src/router/url/url-matcher.js +12 -14
  252. package/src/router/url/url-rule.js +8 -2
  253. package/src/router/url/url-rules.js +8 -5
  254. package/src/router/url/url-service.js +80 -76
  255. package/src/router/url/url-service.spec.js +61 -78
  256. package/src/router/url/url.test.js +1 -0
  257. package/src/router/view/view.js +4 -5
  258. package/src/router/view/view.spec.js +10 -12
  259. package/src/router/view/view.test.js +1 -0
  260. package/src/router/view-hook.spec.js +1 -1
  261. package/src/router/view-scroll.js +3 -1
  262. package/src/router/view-scroll.spec.js +12 -12
  263. package/src/services/anchor-scroll.html +2 -2
  264. package/src/services/anchor-scroll.js +5 -4
  265. package/src/services/http/http.js +9 -4
  266. package/src/services/http/http.spec.js +2 -7
  267. package/src/services/http/template-request.spec.js +1 -1
  268. package/src/services/http-backend/http-backend.js +51 -77
  269. package/src/services/http-backend/http-backend.spec.js +1 -2
  270. package/src/services/http-backend/http-backend.test.js +1 -0
  271. package/src/services/location/interface.ts +62 -0
  272. package/src/services/location/location.js +439 -519
  273. package/src/services/location/location.spec.js +915 -530
  274. package/src/services/location/location.test.js +2 -2
  275. package/src/services/log/log.spec.js +1 -1
  276. package/src/services/log/log.test.js +1 -0
  277. package/src/services/pubsub/pubsub.spec.js +1 -1
  278. package/src/services/sce/sce.js +5 -7
  279. package/src/services/sce/sce.md +2 -2
  280. package/src/services/sce/sce.spec.js +1 -1
  281. package/src/services/template-cache/template-cache.spec.js +1 -1
  282. package/src/services/template-cache/template-cache.test.js +1 -0
  283. package/src/shared/common.js +5 -10
  284. package/src/shared/common.spec.js +1 -1
  285. package/src/shared/hof.js +0 -14
  286. package/src/shared/interface.ts +0 -4
  287. package/src/{router/common → shared}/queue.js +7 -7
  288. package/src/shared/shared.html +1 -0
  289. package/src/shared/shared.test.js +1 -0
  290. package/src/shared/url-utils/interface.ts +0 -2
  291. package/src/shared/url-utils/url-utils.js +6 -30
  292. package/src/shared/url-utils/url-utils.spec.js +10 -9
  293. package/src/shared/utils.js +32 -9
  294. package/src/shared/utils.spec.js +35 -1
  295. package/src/src.html +1 -2
  296. package/typedoc.json +0 -1
  297. package/utils/express.js +27 -1
  298. package/utils/version.cjs +23 -0
  299. package/@types/router/state-provider.d.ts +0 -123
  300. package/src/directive/non-bindable/non-bindable.md +0 -17
  301. package/src/loader.spec.js +0 -169
  302. package/src/router/state-provider.js +0 -146
  303. package/src/services/location/location.md +0 -114
  304. package/src/shared/url-utils/url-utils.md +0 -46
  305. /package/@types/router/{common → glob}/glob.d.ts +0 -0
  306. /package/src/router/{common → glob}/glob.js +0 -0
  307. /package/src/router/{common → glob}/glob.spec.js +0 -0
  308. /package/src/{router/common → shared}/queue.spec.js +0 -0
@@ -352,7 +352,6 @@
352
352
  _ `ngMessages` is a directive that is designed to show and hide messages based on the state
353
353
  _ of a key/value object that it listens on. The directive itself complements error message
354
354
  _ reporting with the `ngModel` $error object (which stores a key/value state of validation errors).
355
-
356
355
  -
357
356
  - `ngMessages` manages the state of internal messages within its container element. The internal
358
357
  - messages use the `ngMessage` directive and will be inserted/removed from the page depending
@@ -440,7 +439,6 @@
440
439
  _ determine what messages are overridden due to the placement of the ngMessagesInclude directive. \*
441
440
  _ @usage
442
441
  _ `html
443
-
444
442
  - <!-- using attribute directives -->
445
443
  - <ANY ng-messages="expression" role="alert">
446
444
  - <ANY ng-messages-include="remoteTplString">...</ANY>
@@ -473,7 +471,6 @@ _ {@link module:ngMessages Click here} to learn more about`ngMessages`and`ngMess
473
471
  _ {@link module:ngMessages `ngMessages` module documentation}. \*
474
472
  _ @usage
475
473
  _ `html
476
-
477
474
  - <!-- using attribute directives -->
478
475
  - <ANY ng-messages="expression" role="alert">
479
476
  - <ANY ng-message="stringValue">...</ANY>
@@ -502,7 +499,6 @@ _ {@link module:ngMessages Click here} to learn more about`ngMessages`and`ngMess
502
499
  _
503
500
  _ @usage
504
501
  _ `html
505
-
506
502
  - <!-- using attribute directives -->
507
503
  - <ANY ng-messages="expression">
508
504
  - <ANY ng-message-exp="expressionValue">...</ANY>
@@ -1,4 +1,4 @@
1
- import { Angular } from "../../loader.js";
1
+ import { Angular } from "../../angular.js";
2
2
  import { wait } from "../../shared/test-utils.js";
3
3
  import { isString } from "../../shared/utils.js";
4
4
  import { getController } from "../../shared/dom.js";
@@ -5,6 +5,7 @@ const TEST_URL = "src/directive/messages/messages.html";
5
5
  test("unit tests contain no errors", async ({ page }) => {
6
6
  await page.goto(TEST_URL);
7
7
  await page.content();
8
+ await page.waitForTimeout(1000);
8
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
9
10
  /0 failures/,
10
11
  );
@@ -9,21 +9,22 @@ import {
9
9
  VALID_CLASS,
10
10
  } from "../../shared/constants.js";
11
11
  import {
12
- minErr,
12
+ hasAnimate,
13
+ isBoolean,
14
+ isFunction,
13
15
  isNumber,
14
16
  isNumberNaN,
17
+ isObjectEmpty,
15
18
  isPromiseLike,
19
+ isProxy,
16
20
  isUndefined,
17
- isFunction,
18
- hasAnimate,
19
- isBoolean,
21
+ minErr,
20
22
  snakeCase,
21
- isObjectEmpty,
22
- isProxy,
23
23
  } from "../../shared/utils.js";
24
24
  import { nullFormCtrl, PENDING_CLASS } from "../form/form.js";
25
25
  import { defaultModelOptions } from "../model-options/model-options.js";
26
26
  import { startingTag } from "../../shared/dom.js";
27
+ import { $injectTokens as $t } from "../../injection-tokens.js";
27
28
 
28
29
  export const ngModelMinErr = minErr("ngModel");
29
30
 
@@ -66,14 +67,14 @@ export const ngModelMinErr = minErr("ngModel");
66
67
 
67
68
  export class NgModelController {
68
69
  static $nonscope = true;
69
- static $inject = [
70
+ /* @ignore */ static $inject = [
70
71
  "$scope",
71
- "$exceptionHandler",
72
+ $t.$exceptionHandler,
72
73
  "$attrs",
73
74
  "$element",
74
- "$parse",
75
- "$animate",
76
- "$interpolate",
75
+ $t.$parse,
76
+ $t.$animate,
77
+ $t.$interpolate,
77
78
  ];
78
79
 
79
80
  /**
@@ -720,8 +721,7 @@ export class NgModelController {
720
721
  }
721
722
 
722
723
  $$parseAndValidate() {
723
- const viewValue = this.$$lastCommittedViewValue;
724
- let modelValue = viewValue;
724
+ let modelValue = this.$$lastCommittedViewValue;
725
725
  const that = this;
726
726
 
727
727
  this.$$parserValid = isUndefined(modelValue) ? undefined : true;
@@ -1,5 +1,5 @@
1
1
  import { createElementFromHTML, dealoc } from "../../shared/dom.js";
2
- import { Angular } from "../../loader.js";
2
+ import { Angular } from "../../angular.js";
3
3
  import { NgModelController } from "./model.js";
4
4
  import { isDefined, isObject } from "../../shared/utils.js";
5
5
  import { browserTrigger, wait } from "../../shared/test-utils.js";
@@ -5,6 +5,7 @@ const TEST_URL = "src/directive/model/model.html";
5
5
  test("unit tests contain no errors", async ({ page }) => {
6
6
  await page.goto(TEST_URL);
7
7
  await page.content();
8
+ await page.waitForTimeout(1000);
8
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
9
10
  /0 failures/,
10
11
  );
@@ -5,6 +5,7 @@ const TEST_URL = "src/directive/model-options/model-options.html";
5
5
  test("unit tests contain no errors", async ({ page }) => {
6
6
  await page.goto(TEST_URL);
7
7
  await page.content();
8
+ await page.waitForTimeout(1000);
8
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
9
10
  /0 failures/,
10
11
  );
@@ -13,7 +13,7 @@ const DEFAULT_REGEXP = /(\s+|^)default(\s+|$)/;
13
13
 
14
14
  class NgModelOptionsController {
15
15
  static $nonscope = true;
16
- static $inject = ["$attrs", "$scope"];
16
+ /* @ignore */ static $inject = ["$attrs", "$scope"];
17
17
 
18
18
  /**
19
19
  * @param {import('../../core/compile/attributes.js').Attributes} $attrs
@@ -1,6 +1,6 @@
1
1
  import { defaultModelOptions } from "./model-options.js";
2
2
  import { dealoc, getController } from "../../shared/dom.js";
3
- import { Angular } from "../../loader.js";
3
+ import { Angular } from "../../angular.js";
4
4
  import { bootstrap, wait } from "../../shared/test-utils.js";
5
5
 
6
6
  function changeGivenInputTo(inputElm, val) {
@@ -1,5 +1,5 @@
1
1
  import { dealoc } from "../../shared/dom.js";
2
- import { Angular } from "../../loader.js";
2
+ import { Angular } from "../../angular.js";
3
3
  import { createInjector } from "../../core/di/injector.js";
4
4
  import { wait } from "../../shared/test-utils.js";
5
5
 
@@ -5,6 +5,7 @@ const TEST_URL = "src/directive/non-bindable/non-bindable.html";
5
5
  test("unit tests contain no errors", async ({ page }) => {
6
6
  await page.goto(TEST_URL);
7
7
  await page.content();
8
+ await page.waitForTimeout(1000);
8
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
9
10
  /0 failures/,
10
11
  );
@@ -1,4 +1,4 @@
1
- import { Angular } from "../../loader.js";
1
+ import { Angular } from "../../angular.js";
2
2
  import { createElementFromHTML, dealoc } from "../../shared/dom.js";
3
3
  import { wait } from "../../shared/test-utils.js";
4
4
 
@@ -3,6 +3,7 @@ import { test, expect } from "@playwright/test";
3
3
  test("unit observer tests contain no errors", async ({ page }) => {
4
4
  await page.goto("src/directive/observe/observe.html");
5
5
  await page.content();
6
+ await page.waitForTimeout(1000);
6
7
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
7
8
  /0 failures/,
8
9
  );
@@ -1,4 +1,4 @@
1
- import { Angular } from "../../loader.js";
1
+ import { Angular } from "../../angular.js";
2
2
  import { browserTrigger, wait } from "../../shared/test-utils.js";
3
3
  import { createInjector } from "../../core/di/injector.js";
4
4
 
@@ -5,6 +5,7 @@ const TEST_URL = "src/directive/on/on.html";
5
5
  test("unit tests contain no errors", async ({ page }) => {
6
6
  await page.goto(TEST_URL);
7
7
  await page.content();
8
+ await page.waitForTimeout(1000);
8
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
9
10
  /0 failures/,
10
11
  );
@@ -1,6 +1,6 @@
1
1
  import { createInjector } from "../../core/di/injector.js";
2
2
  import { dealoc, getController } from "../../shared/dom.js";
3
- import { Angular } from "../../loader.js";
3
+ import { Angular } from "../../angular.js";
4
4
  import {
5
5
  isBoolean,
6
6
  hashKey,
@@ -5,6 +5,7 @@ const TEST_URL = "src/directive/options/options.html";
5
5
  test("unit tests contain no errors", async ({ page }) => {
6
6
  await page.goto(TEST_URL);
7
7
  await page.content();
8
+ await page.waitForTimeout(3000);
8
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
9
10
  /0 failures/,
10
11
  );
@@ -1,4 +1,4 @@
1
- import { Angular } from "../../loader.js";
1
+ import { Angular } from "../../angular.js";
2
2
  import { createInjector } from "../../core/di/injector.js";
3
3
  import { dealoc } from "../../shared/dom.js";
4
4
  import { isDefined } from "../../shared/utils.js";
@@ -3,6 +3,7 @@ import { test, expect } from "@playwright/test";
3
3
  test("unit href tests contain no errors", async ({ page }) => {
4
4
  await page.goto("src/directive/ref/href.html");
5
5
  await page.content();
6
+ await page.waitForTimeout(1000);
6
7
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
7
8
  /0 failures/,
8
9
  );
@@ -11,6 +12,7 @@ test("unit href tests contain no errors", async ({ page }) => {
11
12
  test("unit ref tests contain no errors", async ({ page }) => {
12
13
  await page.goto("src/directive/ref/ref.html");
13
14
  await page.content();
15
+ await page.waitForTimeout(1000);
14
16
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
15
17
  /0 failures/,
16
18
  );
@@ -1,5 +1,5 @@
1
1
  import { createInjector } from "../../core/di/injector.js";
2
- import { Angular } from "../../loader.js";
2
+ import { Angular } from "../../angular.js";
3
3
  import { createElementFromHTML } from "../../shared/dom.js";
4
4
 
5
5
  describe("ngRef", () => {
@@ -85,7 +85,7 @@ export function ngRepeatDirective($animate) {
85
85
  transclude: "element",
86
86
  priority: 1000,
87
87
  terminal: true,
88
- compile: ($element, $attr) => {
88
+ compile: (_$element, $attr) => {
89
89
  const expression = $attr["ngRepeat"];
90
90
  const hasAnimate = !!$attr["animate"];
91
91
 
@@ -1,4 +1,4 @@
1
- import { Angular } from "../../loader.js";
1
+ import { Angular } from "../../angular.js";
2
2
  import { createElementFromHTML, dealoc } from "../../shared/dom.js";
3
3
  import { wait } from "../../shared/test-utils.js";
4
4
 
@@ -88,8 +88,7 @@ describe("ngRepeat", () => {
88
88
  "<a class='test' name='y'>b</a>" +
89
89
  "<a class='test' name='x'>c</a>";
90
90
 
91
- const htmlCollection = document.getElementsByClassName("test");
92
- scope.items = htmlCollection;
91
+ scope.items = document.getElementsByClassName("test");
93
92
  await wait();
94
93
  expect(element.querySelectorAll("li").length).toEqual(3);
95
94
  expect(element.textContent).toEqual("x;y;x;");
@@ -5,6 +5,7 @@ const TEST_URL = "src/directive/repeat/repeat.html";
5
5
  test("unit tests contain no errors", async ({ page }) => {
6
6
  await page.goto(TEST_URL);
7
7
  await page.content();
8
+ await page.waitForTimeout(1000);
8
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
9
10
  /0 failures/,
10
11
  );
@@ -1,4 +1,4 @@
1
- import { Angular } from "../../loader.js";
1
+ import { Angular } from "../../angular.js";
2
2
  import { createInjector } from "../../core/di/injector.js";
3
3
  import { createElementFromHTML } from "../../shared/dom.js";
4
4
  import { wait } from "../../shared/test-utils.js";
@@ -5,6 +5,7 @@ const TEST_URL = "src/directive/script/script.html";
5
5
  test("unit tests contain no errors", async ({ page }) => {
6
6
  await page.goto(TEST_URL);
7
7
  await page.content();
8
+ await page.waitForTimeout(1000);
8
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
9
10
  /0 failures/,
10
11
  );
@@ -27,7 +27,7 @@ class SelectController {
27
27
  /**
28
28
  * @type {Array<string>}
29
29
  */
30
- static $inject = ["$element", "$scope"];
30
+ /* @ignore */ static $inject = ["$element", "$scope"];
31
31
 
32
32
  /**
33
33
  * @param {HTMLSelectElement} $element
@@ -1,4 +1,4 @@
1
- import { Angular } from "../../loader.js";
1
+ import { Angular } from "../../angular.js";
2
2
  import {
3
3
  createElementFromHTML,
4
4
  dealoc,
@@ -5,6 +5,7 @@ const TEST_URL = "src/directive/select/select.html";
5
5
  test("unit tests contain no errors", async ({ page }) => {
6
6
  await page.goto(TEST_URL);
7
7
  await page.content();
8
+ await page.waitForTimeout(1000);
8
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
9
10
  /0 failures/,
10
11
  );
@@ -1,4 +1,4 @@
1
- import { Angular } from "../../loader.js";
1
+ import { Angular } from "../../angular.js";
2
2
  import { dealoc } from "../../shared/dom.js";
3
3
  import { wait } from "../../shared/test-utils.js";
4
4
 
@@ -5,6 +5,7 @@ const TEST_URL = "src/directive/setter/setter.html";
5
5
  test("unit tests contain no errors", async ({ page }) => {
6
6
  await page.goto(TEST_URL);
7
7
  await page.content();
8
+ await page.waitForTimeout(1000);
8
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
9
10
  /0 failures/,
10
11
  );
@@ -1,4 +1,4 @@
1
- import { Angular } from "../../loader.js";
1
+ import { Angular } from "../../angular.js";
2
2
  import { createInjector } from "../../core/di/injector.js";
3
3
  import { dealoc, createElementFromHTML } from "../../shared/dom.js";
4
4
  import { wait } from "../../shared/test-utils.js";
@@ -5,6 +5,7 @@ const TEST_URL = "src/directive/show-hide/show-hide.html";
5
5
  test("unit tests contain no errors", async ({ page }) => {
6
6
  await page.goto(TEST_URL);
7
7
  await page.content();
8
+ await page.waitForTimeout(1000);
8
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
9
10
  /0 failures/,
10
11
  );
@@ -1,4 +1,4 @@
1
- import { Angular } from "../../loader.js";
1
+ import { Angular } from "../../angular.js";
2
2
  import { createInjector } from "../../core/di/injector.js";
3
3
  import { createElementFromHTML, dealoc } from "../../shared/dom.js";
4
4
  import { wait } from "../../shared/test-utils.js";
@@ -5,6 +5,7 @@ const TEST_URL = "src/directive/style/style.html";
5
5
  test("unit tests contain no errors", async ({ page }) => {
6
6
  await page.goto(TEST_URL);
7
7
  await page.content();
8
+ await page.waitForTimeout(1000);
8
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
9
10
  /0 failures/,
10
11
  );
@@ -1,4 +1,4 @@
1
- import { Angular } from "../../loader.js";
1
+ import { Angular } from "../../angular.js";
2
2
  import { dealoc } from "../../shared/dom.js";
3
3
  import { wait } from "../../shared/test-utils.js";
4
4
 
@@ -5,6 +5,7 @@ const TEST_URL = "src/directive/switch/switch.html";
5
5
  test("unit tests contain no errors", async ({ page }) => {
6
6
  await page.goto(TEST_URL);
7
7
  await page.content();
8
+ await page.waitForTimeout(1000);
8
9
  await expect(page.locator(".jasmine-overall-result")).toHaveText(
9
10
  /0 failures/,
10
11
  );
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  isNumberNaN,
3
3
  isString,
4
- toInt,
5
4
  minErr,
6
5
  isUndefined,
7
6
  isProxy,
@@ -9,6 +8,7 @@ import {
9
8
  } from "../../shared/utils.js";
10
9
  import { REGEX_STRING_REGEXP } from "./../attrs/attrs.js";
11
10
  import { startingTag } from "../../shared/dom.js";
11
+ import { $injectTokens as $t } from "../../injection-tokens.js";
12
12
 
13
13
  /**
14
14
  *
@@ -34,7 +34,7 @@ import { startingTag } from "../../shared/dom.js";
34
34
  *
35
35
  */
36
36
  export const requiredDirective = [
37
- "$parse",
37
+ $t.$parse,
38
38
  /**
39
39
  * @param {import("../../core/parse/interface.ts").ParseService} $parse
40
40
  * @returns {import("../../interface.ts").Directive}
@@ -116,75 +116,72 @@ export const requiredDirective = [
116
116
  * </div>
117
117
  */
118
118
  export const patternDirective = [
119
- "$parse",
119
+ $t.$parse,
120
120
  /**
121
121
  * @param {import("../../core/parse/interface.ts").ParseService} $parse
122
122
  * @returns {import("../../interface.ts").Directive}
123
123
  */
124
- ($parse) => {
125
- return {
126
- restrict: "A",
127
- require: "?ngModel",
128
- compile: (_Elm, tAttr) => {
129
- let patternExp;
130
- let parseFn;
124
+ ($parse) => ({
125
+ restrict: "A",
126
+ require: "?ngModel",
127
+ compile: (_Elm, tAttr) => {
128
+ let patternExp;
129
+ let parseFn;
131
130
 
132
- if (tAttr["ngPattern"]) {
133
- patternExp = tAttr["ngPattern"];
131
+ if (tAttr["ngPattern"]) {
132
+ patternExp = tAttr["ngPattern"];
134
133
 
135
- // ngPattern might be a scope expression, or an inlined regex, which is not parsable.
136
- // We get value of the attribute here, so we can compare the old and the new value
137
- // in the observer to avoid unnecessary validations
138
- if (
139
- tAttr["ngPattern"].charAt(0) === "/" &&
140
- REGEX_STRING_REGEXP.test(tAttr["ngPattern"])
141
- ) {
142
- parseFn = function () {
143
- return tAttr["ngPattern"];
144
- };
145
- } else {
146
- parseFn = $parse(tAttr["ngPattern"]);
147
- }
134
+ // ngPattern might be a scope expression, or an inlined regex, which is not parsable.
135
+ // We get value of the attribute here, so we can compare the old and the new value
136
+ // in the observer to avoid unnecessary validations
137
+ if (
138
+ tAttr["ngPattern"].charAt(0) === "/" &&
139
+ REGEX_STRING_REGEXP.test(tAttr["ngPattern"])
140
+ ) {
141
+ parseFn = function () {
142
+ return tAttr["ngPattern"];
143
+ };
144
+ } else {
145
+ parseFn = $parse(tAttr["ngPattern"]);
148
146
  }
147
+ }
149
148
 
150
- return function (scope, elm, attr, ctrl) {
151
- if (!ctrl) return;
152
-
153
- let attrVal = attr["pattern"];
149
+ return function (scope, elm, attr, ctrl) {
150
+ if (!ctrl) return;
151
+ let attrVal = attr["pattern"];
154
152
 
155
- if (attr["ngPattern"]) {
156
- attrVal = parseFn(scope);
157
- } else {
158
- patternExp = attr["pattern"];
159
- }
153
+ if (attr["ngPattern"]) {
154
+ attrVal = parseFn(scope);
155
+ } else {
156
+ patternExp = attr["pattern"];
157
+ }
160
158
 
161
- let regexp = parsePatternAttr(attrVal, patternExp, elm);
162
- attr.$observe("pattern", function (newVal) {
163
- const oldRegexp = regexp;
159
+ let regexp = parsePatternAttr(attrVal, patternExp, elm);
160
+ attr.$observe("pattern", (newVal) => {
161
+ const oldRegexp = regexp;
164
162
 
165
- regexp = parsePatternAttr(newVal, patternExp, elm);
163
+ regexp = parsePatternAttr(newVal, patternExp, elm);
166
164
 
167
- if (
168
- (oldRegexp && oldRegexp.toString()) !==
169
- (regexp && regexp.toString())
170
- ) {
171
- ctrl["$validate"]();
172
- }
173
- });
165
+ if (
166
+ (oldRegexp && oldRegexp.toString()) !==
167
+ (regexp && regexp.toString())
168
+ ) {
169
+ ctrl["$validate"]();
170
+ }
171
+ });
174
172
 
175
- ctrl["$validators"]["pattern"] = function (modelValue, viewValue) {
176
- // HTML5 pattern constraint validates the input value, so we validate the viewValue
177
- return (
178
- // @ts-ignore
179
- ctrl.$isEmpty(viewValue) ||
180
- isUndefined(regexp) ||
181
- regexp.test(viewValue)
182
- );
183
- };
173
+ ctrl["$validators"]["pattern"] = (_modelValue, viewValue) => {
174
+ // HTML5 pattern constraint validates the input value, so we validate the viewValue
175
+ return (
176
+ // @ts-ignore
177
+ ctrl.$isEmpty(viewValue) ||
178
+ isUndefined(regexp) ||
179
+ regexp.test(viewValue)
180
+ );
184
181
  };
185
- },
186
- };
187
- },
182
+ };
183
+ },
184
+ }),
188
185
  ];
189
186
 
190
187
  /**
@@ -218,7 +215,7 @@ export const patternDirective = [
218
215
  *
219
216
  */
220
217
  export const maxlengthDirective = [
221
- "$parse",
218
+ $t.$parse,
222
219
  /**
223
220
  * @param {import("../../core/parse/interface.ts").ParseService} $parse
224
221
  * @returns {import("../../interface.ts").Directive}
@@ -290,32 +287,28 @@ export const maxlengthDirective = [
290
287
  *
291
288
  */
292
289
  export const minlengthDirective = [
293
- "$parse",
294
- function ($parse) {
295
- return {
296
- restrict: "A",
297
- require: "?ngModel",
298
- link(scope, elm, attr, ctrl) {
299
- if (!ctrl) return;
290
+ $t.$parse,
291
+ ($parse) => ({
292
+ restrict: "A",
293
+ require: "?ngModel",
294
+ link(scope, elm, attr, ctrl) {
295
+ if (!ctrl) return;
300
296
 
301
- let minlength = attr.minlength || $parse(attr.ngMinlength)(scope);
302
- let minlengthParsed = parseLength(minlength) || -1;
297
+ let minlength = attr.minlength || $parse(attr.ngMinlength)(scope);
298
+ let minlengthParsed = parseLength(minlength) || -1;
303
299
 
304
- attr.$observe("minlength", (value) => {
305
- if (minlength !== value) {
306
- minlengthParsed = parseLength(value) || -1;
307
- minlength = value;
308
- ctrl.$validate();
309
- }
310
- });
311
- ctrl.$validators.minlength = function (modelValue, viewValue) {
312
- return (
313
- ctrl.$isEmpty(viewValue) || viewValue.length >= minlengthParsed
314
- );
315
- };
316
- },
317
- };
318
- },
300
+ attr.$observe("minlength", (value) => {
301
+ if (minlength !== value) {
302
+ minlengthParsed = parseLength(value) || -1;
303
+ minlength = value;
304
+ ctrl.$validate();
305
+ }
306
+ });
307
+ ctrl.$validators.minlength = function (modelValue, viewValue) {
308
+ return ctrl.$isEmpty(viewValue) || viewValue.length >= minlengthParsed;
309
+ };
310
+ },
311
+ }),
319
312
  ];
320
313
 
321
314
  function parsePatternAttr(regex, patternExp, elm) {
@@ -326,7 +319,12 @@ function parsePatternAttr(regex, patternExp, elm) {
326
319
  }
327
320
 
328
321
  if (isString(regex)) {
329
- regex = new RegExp(`^${regex}$`);
322
+ const match = regex.match(/^\/(.*)\/([gimsuy]*)$/);
323
+ if (match) {
324
+ regex = new RegExp(match[1], match[2]);
325
+ } else {
326
+ regex = new RegExp(`^${regex}$`);
327
+ }
330
328
  }
331
329
 
332
330
  if (!regex.test) {
@@ -343,6 +341,6 @@ function parsePatternAttr(regex, patternExp, elm) {
343
341
  }
344
342
 
345
343
  function parseLength(val) {
346
- const intVal = toInt(val);
344
+ const intVal = parseInt(val, 10);
347
345
  return isNumberNaN(intVal) ? -1 : intVal;
348
346
  }