@angular-wave/angular.ts 0.0.7 → 0.0.8

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 (65) hide show
  1. package/dist/angular-ts.cjs.js +1 -1
  2. package/dist/angular-ts.esm.js +1 -1
  3. package/dist/angular-ts.umd.js +1 -1
  4. package/docs/.cspell.yml +8 -0
  5. package/docs/.github/dependabot.yml +14 -0
  6. package/docs/.nvmrc +1 -0
  7. package/docs/CONTRIBUTING.md +28 -0
  8. package/docs/Dockerfile +4 -0
  9. package/docs/LICENSE +201 -0
  10. package/docs/README.md +184 -0
  11. package/docs/assets/scss/_variables_project.scss +6 -0
  12. package/docs/config.yaml +15 -0
  13. package/docs/content/en/_index.md +77 -0
  14. package/docs/content/en/about/featured-background.jpg +0 -0
  15. package/docs/content/en/about/index.md +35 -0
  16. package/docs/content/en/blog/_index.md +8 -0
  17. package/docs/content/en/blog/news/_index.md +4 -0
  18. package/docs/content/en/blog/news/first-post/featured-sunset-get.png +0 -0
  19. package/docs/content/en/blog/news/first-post/index.md +48 -0
  20. package/docs/content/en/blog/news/second-post.md +244 -0
  21. package/docs/content/en/blog/releases/_index.md +4 -0
  22. package/docs/content/en/blog/releases/in-depth-monoliths-detailed-spec.md +244 -0
  23. package/docs/content/en/community/_index.md +6 -0
  24. package/docs/content/en/docs/_index.md +29 -0
  25. package/docs/content/en/docs/concepts/_index.md +14 -0
  26. package/docs/content/en/docs/contribution-guidelines/_index.md +79 -0
  27. package/docs/content/en/docs/examples/_index.md +13 -0
  28. package/docs/content/en/docs/getting-started/_index.md +35 -0
  29. package/docs/content/en/docs/getting-started/example-page.md +240 -0
  30. package/docs/content/en/docs/overview/_index.md +36 -0
  31. package/docs/content/en/docs/reference/_index.md +12 -0
  32. package/docs/content/en/docs/reference/parameter-reference.md +211 -0
  33. package/docs/content/en/docs/tasks/Ponycopters/_index.md +12 -0
  34. package/docs/content/en/docs/tasks/Ponycopters/configuring-ponycopters.md +238 -0
  35. package/docs/content/en/docs/tasks/Ponycopters/launching-ponycopters.md +236 -0
  36. package/docs/content/en/docs/tasks/_index.md +21 -0
  37. package/docs/content/en/docs/tasks/beds.md +237 -0
  38. package/docs/content/en/docs/tasks/porridge.md +237 -0
  39. package/docs/content/en/docs/tasks/task.md +237 -0
  40. package/docs/content/en/docs/tutorials/_index.md +13 -0
  41. package/docs/content/en/docs/tutorials/multi-bear.md +236 -0
  42. package/docs/content/en/docs/tutorials/tutorial2.md +236 -0
  43. package/docs/content/en/featured-background.jpg +0 -0
  44. package/docs/content/en/search.md +4 -0
  45. package/docs/docker-compose.yaml +13 -0
  46. package/docs/docsy.work +5 -0
  47. package/docs/docsy.work.sum +0 -0
  48. package/docs/go.mod +5 -0
  49. package/docs/go.sum +6 -0
  50. package/docs/hugo-disabled.toml +221 -0
  51. package/docs/hugo.yaml +220 -0
  52. package/docs/layouts/404.html +7 -0
  53. package/docs/layouts/_default/_markup/render-heading.html +1 -0
  54. package/docs/netlify.toml +12 -0
  55. package/docs/package.json +42 -0
  56. package/package.json +1 -1
  57. package/src/core/compile.js +13 -165
  58. package/src/core/compile.md +51 -16
  59. package/src/core/filter.md +23 -17
  60. package/src/core/interval.md +73 -72
  61. package/src/core/sce.js +2 -13
  62. package/src/injector.md +30 -1
  63. package/test/messages/messages.spec.js +1 -1
  64. package/test/ng/compile.spec.js +91 -289
  65. package/test/ng/directive/form.spec.js +8 -8
@@ -18,6 +18,7 @@
18
18
  - ```js
19
19
 
20
20
  ```
21
+
21
22
  - // Filter registration
22
23
  - function MyModule($provide, $filterProvider) {
23
24
  - // create a service to demonstrate injection (not always needed)
@@ -39,6 +40,7 @@
39
40
  - ```
40
41
 
41
42
  ```
43
+
42
44
  -
43
45
  - The filter function is registered with the `$injector` under the filter name suffix with
44
46
  - `Filter`.
@@ -46,6 +48,7 @@
46
48
  - ```js
47
49
 
48
50
  ```
51
+
49
52
  - it('should be the same instance', inject(
50
53
  - function($filterProvider) {
51
54
  - $filterProvider.register('reverse', function(){
@@ -58,6 +61,7 @@
58
61
  - ```
59
62
 
60
63
  ```
64
+
61
65
  -
62
66
  -
63
67
  - For more information about how AngularJS filters work, and how to create your own filters, see
@@ -81,31 +85,33 @@
81
85
  - ```html
82
86
 
83
87
  ```
88
+
84
89
  - {{ expression [| filter_name[:parameter_value] ... ] }}
85
90
  - ```
86
91
 
87
92
  ```
93
+
88
94
  -
89
95
  - @param {String} name Name of the filter function to retrieve
90
96
  - @return {Function} the filter function
91
97
  - @example
92
- <example name="$filter" module="filterExample">
93
- <file name="index.html">
94
- <div ng-controller="MainCtrl">
95
- <h3>{{ originalText }}</h3>
96
- <h3>{{ filteredText }}</h3>
97
- </div>
98
- </file>
99
-
100
- <file name="script.js">
101
- angular.module('filterExample', [])
102
- .controller('MainCtrl', function($scope, $filter) {
103
- $scope.originalText = 'hello';
104
- $scope.filteredText = $filter('uppercase')($scope.originalText);
105
- });
106
- </file>
107
- </example>
108
- */
98
+ <example name="$filter" module="filterExample">
99
+ <file name="index.html">
100
+ <div ng-controller="MainCtrl">
101
+ <h3>{{ originalText }}</h3>
102
+ <h3>{{ filteredText }}</h3>
103
+ </div>
104
+ </file>
105
+
106
+ <file name="script.js">
107
+ angular.module('filterExample', [])
108
+ .controller('MainCtrl', function($scope, $filter) {
109
+ $scope.originalText = 'hello';
110
+ $scope.filteredText = $filter('uppercase')($scope.originalText);
111
+ });
112
+ </file>
113
+ </example>
114
+ */
109
115
 
110
116
  /\*\*
111
117
 
@@ -38,58 +38,59 @@ _ <file name="index.html">
38
38
  _ <script>
39
39
  _ angular.module('intervalExample', [])
40
40
  _ .controller('ExampleController', ['$scope', '$interval',
41
- * function($scope, $interval) {
42
- * $scope.format = 'M/d/yy h:mm:ss a';
43
- * $scope.blood_1 = 100;
44
- * $scope.blood_2 = 120;
45
- *
46
- * let stop;
47
- * $scope.fight = function() {
48
- * // Don't start a new fight if we are already fighting
49
- * if ( angular.isDefined(stop) ) return;
50
- *
51
- * stop = $interval(function() {
52
- * if ($scope.blood_1 > 0 && $scope.blood_2 > 0) {
53
- * $scope.blood_1 = $scope.blood_1 - 3;
54
- * $scope.blood_2 = $scope.blood_2 - 4;
55
- * } else {
56
- * $scope.stopFight();
57
- * }
58
- * }, 100);
59
- * };
60
- *
61
- * $scope.stopFight = function() {
62
- * if (angular.isDefined(stop)) {
63
- * $interval.cancel(stop);
64
- * stop = undefined;
65
- * }
66
- * };
67
- *
68
- * $scope.resetFight = function() {
69
- * $scope.blood_1 = 100;
70
- * $scope.blood_2 = 120;
71
- * };
72
- *
73
- * $scope.$on('$destroy', function() {
74
- * // Make sure that the interval is destroyed too
75
- * $scope.stopFight();
76
- * });
77
- * }])
78
- _ // Register the 'myCurrentTime' directive factory method.
79
- _ // We inject $interval and dateFilter service since the factory method is DI.
41
+
42
+ - function($scope, $interval) {
43
+ - $scope.format = 'M/d/yy h:mm:ss a';
44
+ - $scope.blood_1 = 100;
45
+ - $scope.blood_2 = 120;
46
+ -
47
+ - let stop;
48
+ - $scope.fight = function() {
49
+ - // Don't start a new fight if we are already fighting
50
+ - if ( angular.isDefined(stop) ) return;
51
+ -
52
+ - stop = $interval(function() {
53
+ - if ($scope.blood_1 > 0 && $scope.blood_2 > 0) {
54
+ - $scope.blood_1 = $scope.blood_1 - 3;
55
+ - $scope.blood_2 = $scope.blood_2 - 4;
56
+ - } else {
57
+ - $scope.stopFight();
58
+ - }
59
+ - }, 100);
60
+ - };
61
+ -
62
+ - $scope.stopFight = function() {
63
+ - if (angular.isDefined(stop)) {
64
+ - $interval.cancel(stop);
65
+ - stop = undefined;
66
+ - }
67
+ - };
68
+ -
69
+ - $scope.resetFight = function() {
70
+ - $scope.blood_1 = 100;
71
+ - $scope.blood_2 = 120;
72
+ - };
73
+ -
74
+ - $scope.$on('$destroy', function() {
75
+ - // Make sure that the interval is destroyed too
76
+ - $scope.stopFight();
77
+ - });
78
+ - }])
79
+ _ // Register the 'myCurrentTime' directive factory method.
80
+ _ // We inject $interval and dateFilter service since the factory method is DI.
80
81
  * .directive('myCurrentTime', ['$interval', 'dateFilter',
81
- _ function($interval, dateFilter) {
82
- _ // return the directive link function. (compile function not needed)
83
- _ return function(scope, element, attrs) {
84
- _ let format, // date format
85
- _ stopTime; // so that we can cancel the time updates
86
- _
87
- _ // used to update the UI
88
- _ function updateTime() {
89
- _ element.text(dateFilter(new Date(), format));
90
- _ } \*
91
- _ // watch the expression, and update the UI on change.
92
- _ scope.$watch(attrs.myCurrentTime, function(value) {
82
+ _ function($interval, dateFilter) {
83
+ _ // return the directive link function. (compile function not needed)
84
+ _ return function(scope, element, attrs) {
85
+ _ let format, // date format
86
+ _ stopTime; // so that we can cancel the time updates
87
+ _
88
+ _ // used to update the UI
89
+ _ function updateTime() {
90
+ _ element.text(dateFilter(new Date(), format));
91
+ _ } \*
92
+ _ // watch the expression, and update the UI on change.
93
+ _ scope.$watch(attrs.myCurrentTime, function(value) {
93
94
  * format = value;
94
95
  * updateTime();
95
96
  * });
@@ -99,24 +100,24 @@ _ scope.$watch(attrs.myCurrentTime, function(value) {
99
100
  * // listen on DOM destroy (removal) event, and cancel the next UI update
100
101
  * // to prevent updating time after the DOM element was removed.
101
102
  * element.on('$destroy', function() {
102
- _ $interval.cancel(stopTime);
103
- _ });
104
- _ }
105
- _ }]);
106
- _ </script>
107
- _
108
- _ <div>
109
- _ <div ng-controller="ExampleController">
110
- _ <label>Date format: <input ng-model="format"></label> <hr/>
111
- _ Current time is: <span my-current-time="format"></span>
112
- _ <hr/>
113
- _ Blood 1 : <font color='red'>{{blood_1}}</font>
114
- _ Blood 2 : <font color='red'>{{blood_2}}</font>
115
- _ <button type="button" data-ng-click="fight()">Fight</button>
116
- _ <button type="button" data-ng-click="stopFight()">StopFight</button>
117
- _ <button type="button" data-ng-click="resetFight()">resetFight</button>
118
- _ </div>
119
- _ </div> \*
120
- _ </file>
121
- _ </example>
122
- \*/
103
+ _ $interval.cancel(stopTime);
104
+ _ });
105
+ _ }
106
+ _ }]);
107
+ _ </script>
108
+ _
109
+ _ <div>
110
+ _ <div ng-controller="ExampleController">
111
+ _ <label>Date format: <input ng-model="format"></label> <hr/>
112
+ _ Current time is: <span my-current-time="format"></span>
113
+ _ <hr/>
114
+ _ Blood 1 : <font color='red'>{{blood_1}}</font>
115
+ _ Blood 2 : <font color='red'>{{blood_2}}</font>
116
+ _ <button type="button" data-ng-click="fight()">Fight</button>
117
+ _ <button type="button" data-ng-click="stopFight()">StopFight</button>
118
+ _ <button type="button" data-ng-click="resetFight()">resetFight</button>
119
+ _ </div>
120
+ _ </div> \*
121
+ _ </file>
122
+ _ </example>
123
+ \*/
package/src/core/sce.js CHANGED
@@ -5,7 +5,6 @@ import {
5
5
  } from "./urlUtils";
6
6
  import {
7
7
  forEach,
8
- isDefined,
9
8
  isFunction,
10
9
  isRegExp,
11
10
  isString,
@@ -88,16 +87,6 @@ export function adjustMatcher(matcher) {
88
87
  );
89
88
  }
90
89
 
91
- function adjustMatchers(matchers) {
92
- const adjustedMatchers = [];
93
- if (isDefined(matchers)) {
94
- forEach(matchers, (matcher) => {
95
- adjustedMatchers.push(adjustMatcher(matcher));
96
- });
97
- }
98
- return adjustedMatchers;
99
- }
100
-
101
90
  /**
102
91
  * @ngdoc service
103
92
  * @name $sceDelegate
@@ -222,7 +211,7 @@ export function $SceDelegateProvider() {
222
211
  */
223
212
  this.trustedResourceUrlList = function (value) {
224
213
  if (arguments.length) {
225
- trustedResourceUrlList = adjustMatchers(value);
214
+ trustedResourceUrlList = value.map((v) => adjustMatcher(v));
226
215
  }
227
216
  return trustedResourceUrlList;
228
217
  };
@@ -254,7 +243,7 @@ export function $SceDelegateProvider() {
254
243
  */
255
244
  this.bannedResourceUrlList = function (value) {
256
245
  if (arguments.length) {
257
- bannedResourceUrlList = adjustMatchers(value);
246
+ bannedResourceUrlList = value.map((v) => adjustMatcher(v));
258
247
  }
259
248
  return bannedResourceUrlList;
260
249
  };
package/src/injector.md CHANGED
@@ -20,6 +20,7 @@
20
20
  - ```js
21
21
 
22
22
  ```
23
+
23
24
  - // create an injector
24
25
  - var $injector = angular.injector(['ng']);
25
26
  -
@@ -32,6 +33,7 @@
32
33
  - ```
33
34
 
34
35
  ```
36
+
35
37
  -
36
38
  - Sometimes you want to get access to the injector of a currently running AngularJS app
37
39
  - from outside AngularJS. Perhaps, you want to inject and compile some markup after the
@@ -48,6 +50,7 @@
48
50
  - ```js
49
51
 
50
52
  ```
53
+
51
54
  - var $div = $('<div ng-controller="MyCtrl">{{content.label}}</div>');
52
55
  - $(document.body).append($div);
53
56
  -
@@ -87,6 +90,7 @@
87
90
  - ```js
88
91
 
89
92
  ```
93
+
90
94
  - var $injector = angular.injector();
91
95
  - expect($injector.get('$injector')).toBe($injector);
92
96
  - expect($injector.invoke(function($injector) {
@@ -95,6 +99,7 @@
95
99
  - ```
96
100
 
97
101
  ```
102
+
98
103
  -
99
104
  - ## Injection Function Annotation
100
105
  -
@@ -104,6 +109,7 @@
104
109
  - ```js
105
110
 
106
111
  ```
112
+
107
113
  - // inferred (only works if code not minified/obfuscated)
108
114
  - $injector.invoke(function(serviceA){});
109
115
  -
@@ -117,6 +123,7 @@
117
123
  - ```
118
124
 
119
125
  ```
126
+
120
127
  -
121
128
  - ### Inference
122
129
  -
@@ -150,10 +157,12 @@
150
157
  - ```
151
158
 
152
159
  ```
160
+
153
161
  - var info = $injector.modules['ngAnimate'].info();
154
162
  - ```
155
163
 
156
164
  ```
165
+
157
166
  -
158
167
  - \*\*Do not use this property to attempt to modify the modules after the application
159
168
  - has been bootstrapped.\*\*
@@ -234,6 +243,7 @@
234
243
  - ```js
235
244
 
236
245
  ```
246
+
237
247
  - // Given
238
248
  - function MyController($scope, $route) {
239
249
  - // ...
@@ -244,6 +254,7 @@
244
254
  - ```
245
255
 
246
256
  ```
257
+
247
258
  -
248
259
  - You can disallow this method by using strict injection mode.
249
260
  -
@@ -257,6 +268,7 @@
257
268
  - ```js
258
269
 
259
270
  ```
271
+
260
272
  - // Given
261
273
  - var MyController = function(obfuscatedScope, obfuscatedRoute) {
262
274
  - // ...
@@ -269,6 +281,7 @@
269
281
  - ```
270
282
 
271
283
  ```
284
+
272
285
  -
273
286
  - #### The array notation
274
287
  -
@@ -279,6 +292,7 @@
279
292
  - ```js
280
293
 
281
294
  ```
295
+
282
296
  - // We wish to write this (not minification / obfuscation safe)
283
297
  - injector.invoke(function($compile, $rootScope) {
284
298
  - // ...
@@ -303,6 +317,7 @@
303
317
  - ```
304
318
 
305
319
  ```
320
+
306
321
  -
307
322
  - @param {Function|Array.<string|Function>} fn Function for which dependent service names need to
308
323
  - be retrieved as described above.
@@ -338,6 +353,7 @@
338
353
  - ```javascript
339
354
 
340
355
  ```
356
+
341
357
  - app.factory('loadModule', function($injector) {
342
358
  - return function loadModule(moduleName, bundleUrl) {
343
359
  - return getScript(bundleUrl).then(function() { $injector.loadNewModules([moduleName]); });
@@ -346,6 +362,7 @@
346
362
  - ```
347
363
 
348
364
  ```
365
+
349
366
  -
350
367
  - @param {Array<String|Function|Array>=} mods an array of modules to load into the application.
351
368
  - Each item in the array should be the name of a predefined module or a (DI annotated)
@@ -421,7 +438,7 @@
421
438
  - but the injected provider must have been defined before the one that requires it.
422
439
  -
423
440
  - @param {string} name The name of the instance. NOTE: the provider will be available under `name +
424
- 'Provider'` key.
441
+ 'Provider'` key.
425
442
  - @param {(Object|function())} provider If the provider is:
426
443
  -
427
444
  - - `Object`: then it should have a `$get` method. The `$get` method will be invoked using
@@ -439,6 +456,7 @@
439
456
  - ```js
440
457
 
441
458
  ```
459
+
442
460
  - // Define the eventTracker provider
443
461
  - function EventTrackerProvider() {
444
462
  - var trackingUrl = '/track';
@@ -521,6 +539,7 @@
521
539
  - ```js
522
540
 
523
541
  ```
542
+
524
543
  - $provide.factory('ping', ['$http', function($http) {
525
544
  - return function ping() {
526
545
  - return $http.send('/ping');
@@ -529,10 +548,12 @@
529
548
  - ```
530
549
 
531
550
  ```
551
+
532
552
  - You would then inject and use this service like this:
533
553
  - ```js
534
554
 
535
555
  ```
556
+
536
557
  - someModule.controller('Ctrl', ['ping', function(ping) {
537
558
  - ping();
538
559
  - }]);
@@ -557,6 +578,7 @@
557
578
  - ```
558
579
 
559
580
  ```
581
+
560
582
  - {
561
583
  - $get: function() {
562
584
  - return $injector.instantiate(constructor);
@@ -565,6 +587,7 @@
565
587
  - ```
566
588
 
567
589
  ```
590
+
568
591
  -
569
592
  -
570
593
  - You should use {@link auto.$provide#service $provide.service(class)} if you define your service
@@ -581,6 +604,7 @@
581
604
  - ```js
582
605
 
583
606
  ```
607
+
584
608
  - var Ping = function($http) {
585
609
  - this.$http = $http;
586
610
  - };
@@ -594,10 +618,12 @@
594
618
  - ```
595
619
 
596
620
  ```
621
+
597
622
  - You would then inject and use this service like this:
598
623
  - ```js
599
624
 
600
625
  ```
626
+
601
627
  - someModule.controller('Ctrl', ['ping', function(ping) {
602
628
  - ping.send();
603
629
  - }]);
@@ -629,6 +655,7 @@
629
655
  - ```js
630
656
 
631
657
  ```
658
+
632
659
  - $provide.value('ADMIN_USER', 'admin');
633
660
  -
634
661
  - $provide.value('RoleLookup', { admin: 0, writer: 1, reader: 2 });
@@ -663,6 +690,7 @@
663
690
  - ```js
664
691
 
665
692
  ```
693
+
666
694
  - $provide.constant('SHARD_HEIGHT', 306);
667
695
  -
668
696
  - $provide.constant('MY_COLOURS', ['red', 'blue', 'grey']);
@@ -702,6 +730,7 @@
702
730
  - ```js
703
731
 
704
732
  ```
733
+
705
734
  - $provide.decorator('$log', ['$delegate', function($delegate) {
706
735
  - $delegate.warn = $delegate.error;
707
736
  - return $delegate;
@@ -827,7 +827,7 @@ describe("ngMessages", () => {
827
827
 
828
828
  // // with the 2nd item gone and the values changed
829
829
  // // we should see both 1 and 3 changed
830
- // expect(element.text().trim()).toBe("CA");
830
+ // expect(element.text().trim()).toBe("A");
831
831
 
832
832
  // $rootScope.$apply(() => {
833
833
  // // add the value for the 2nd item back