@angular-wave/angular.ts 0.4.2 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular-ts.esm.js +2 -2
- package/dist/angular-ts.umd.js +12 -2
- package/index.html +74 -3
- package/package.json +7 -7
- package/src/angular.spec.js +1 -269
- package/src/animations/animate-css-driver.js +2 -2
- package/src/animations/animate-css.js +12 -21
- package/src/animations/animate-js-driver.js +1 -3
- package/src/animations/animate-js.js +4 -4
- package/src/animations/animate-queue.js +23 -23
- package/src/animations/animate-runner.js +4 -8
- package/src/animations/animate.md +1 -1
- package/src/animations/animate.spec.js +0 -21
- package/src/animations/animation.js +4 -4
- package/src/animations/shared.js +14 -12
- package/src/binding.spec.js +0 -1
- package/src/core/cache/cache.js +2 -29
- package/src/core/compile/attributes.js +2 -3
- package/src/core/compile/compile.js +260 -245
- package/src/core/compile/compile.spec.js +63 -317
- package/src/core/compile/compile.test.js +1 -1
- package/src/core/controller/controller.js +2 -0
- package/src/core/di/injector.md +1 -1
- package/src/core/di/injector.spec.js +0 -2
- package/src/core/di/internal-injector.js +2 -1
- package/src/core/interpolate/interpolate.js +16 -3
- package/src/core/interpolate/interpolate.spec.js +70 -16
- package/src/core/location/location.js +0 -2
- package/src/core/location/location.spec.js +27 -27
- package/src/core/{scope/scope.html → model/model.html} +1 -1
- package/src/core/model/model.js +944 -0
- package/src/core/model/model.spec.js +3012 -0
- package/src/core/on.spec.js +0 -7
- package/src/core/parse/interpreter.js +10 -7
- package/src/core/parse/parse.js +28 -7
- package/src/core/parse/parse.spec.js +95 -91
- package/src/core/prop.spec.js +4 -60
- package/src/core/sce/sce.js +1 -2
- package/src/core/sce/sce.spec.js +0 -8
- package/src/core/scope/scope.js +62 -32
- package/src/core/scope/scope.spec.js +25 -1960
- package/src/directive/aria/aria.js +3 -6
- package/src/directive/aria/aria.spec.js +0 -87
- package/src/directive/attrs/attrs.spec.js +0 -5
- package/src/directive/{list/list.test.js → attrs/attrs.test.js} +1 -1
- package/src/{core/q/q.html → directive/attrs/boolean.html} +1 -1
- package/src/directive/attrs/boolean.spec.js +0 -15
- package/src/{core/q/q.test.js → directive/attrs/boolean.test.js} +1 -2
- package/src/{core/timeout/timeout.html → directive/attrs/element-style.html} +4 -1
- package/src/directive/attrs/element-style.spec.js +0 -8
- package/src/{core/scope/scope.test.js → directive/attrs/element-style.test.js} +1 -2
- package/src/directive/attrs/src.spec.js +0 -7
- package/src/directive/bind/bind.spec.js +0 -33
- package/src/directive/bind/bing-html.spec.js +1 -4
- package/src/{core/interval/interval.html → directive/channel/channel.html} +1 -1
- package/src/directive/channel/channel.js +29 -0
- package/src/directive/channel/channel.spec.js +52 -0
- package/src/directive/channel/channel.test.js +9 -0
- package/src/directive/class/class.js +3 -3
- package/src/directive/class/class.spec.js +9 -75
- package/src/directive/controller/controller.spec.js +0 -13
- package/src/directive/events/click.spec.js +0 -3
- package/src/directive/events/event.spec.js +0 -6
- package/src/directive/form/form.js +14 -22
- package/src/directive/form/form.spec.js +0 -65
- package/src/directive/if/if.spec.js +2 -7
- package/src/directive/if/if.test.js +1 -2
- package/src/directive/include/include.js +2 -2
- package/src/directive/include/include.spec.js +8 -59
- package/src/directive/init/init.js +6 -2
- package/src/directive/init/init.spec.js +0 -2
- package/src/directive/input/input.js +1 -2
- package/src/directive/input/input.spec.js +191 -331
- package/src/directive/messages/messages.spec.js +4 -35
- package/src/directive/model/model.js +30 -42
- package/src/directive/model/model.spec.js +2 -49
- package/src/directive/model-options/model-options.js +22 -26
- package/src/directive/model-options/model-options.spec.js +0 -6
- package/src/directive/non-bindable/non-bindable.spec.js +0 -1
- package/src/directive/observe/observe.js +0 -1
- package/src/directive/observe/observe.spec.js +0 -1
- package/src/directive/options/options.js +1 -3
- package/src/directive/options/options.spec.js +3 -38
- package/src/directive/ref/href.spec.js +0 -15
- package/src/directive/repeat/repeat.js +2 -2
- package/src/directive/repeat/repeat.spec.js +56 -192
- package/src/directive/script/script.spec.js +0 -2
- package/src/directive/select/select.js +3 -3
- package/src/directive/select/select.spec.js +9 -106
- package/src/directive/show-hide/show-hide.js +2 -2
- package/src/directive/show-hide/show-hide.spec.js +8 -19
- package/src/directive/style/style.spec.js +0 -7
- package/src/directive/switch/switch.js +1 -2
- package/src/directive/switch/switch.spec.js +5 -5
- package/src/directive/validators/validators.spec.js +0 -1
- package/src/loader.js +0 -1
- package/src/public.js +75 -80
- package/src/router/common/coreservices.js +0 -2
- package/src/router/directives/state-directives.js +24 -30
- package/src/router/directives/state-directives.spec.js +0 -83
- package/src/router/directives/view-directive.js +6 -15
- package/src/router/directives/view-directive.spec.js +25 -71
- package/src/router/hooks/lazy-load.js +2 -2
- package/src/router/hooks/views.js +3 -5
- package/src/router/resolve/resolvable.js +3 -6
- package/src/router/resolve/resolve-context.js +2 -2
- package/src/router/state/state-service.js +4 -4
- package/src/router/state/state.spec.js +2 -5
- package/src/router/state/views.js +9 -12
- package/src/router/template-factory.js +3 -6
- package/src/router/template-factory.spec.js +0 -4
- package/src/router/transition/transition-hook.js +1 -1
- package/src/router/transition/transition.js +1 -1
- package/src/router/url/url-service.js +2 -8
- package/src/router/url/url-service.spec.js +3 -4
- package/src/router/view-hook.spec.js +2 -2
- package/src/router/view-scroll.js +4 -6
- package/src/services/http/http.js +11 -15
- package/src/services/http/http.spec.js +30 -31
- package/src/services/http/template-request.spec.js +0 -10
- package/src/services/http-backend/http-backend.js +19 -17
- package/src/services/http-backend/http-backend.spec.js +3 -3
- package/src/services/template-request.js +2 -4
- package/src/shared/common.js +6 -10
- package/src/shared/jqlite/jqlite.js +14 -15
- package/src/shared/jqlite/jqlite.spec.js +2 -2
- package/src/shared/utils.js +15 -92
- package/types/core/cache/cache.d.ts +1 -1
- package/types/core/model/model.d.ts +204 -0
- package/types/core/parse/parse.d.ts +26 -0
- package/types/core/scope/scope.d.ts +22 -21
- package/types/directive/channel/channel.d.ts +11 -0
- package/types/directive/form/form.d.ts +1 -0
- package/types/shared/common.d.ts +0 -1
- package/types/shared/utils.d.ts +0 -35
- package/src/core/interval/interval-factory.js +0 -50
- package/src/core/interval/interval.js +0 -77
- package/src/core/interval/interval.md +0 -123
- package/src/core/interval/interval.spec.js +0 -280
- package/src/core/q/q.js +0 -472
- package/src/core/q/q.md +0 -211
- package/src/core/q/q.spec.js +0 -2748
- package/src/core/timeout/timeout.js +0 -109
- package/src/core/timeout/timeout.spec.js +0 -354
- package/src/core/timeout/timout.test.js +0 -12
- package/src/directive/list/list.html +0 -18
- package/src/directive/list/list.js +0 -46
- package/src/directive/list/list.md +0 -22
- package/src/directive/list/list.spec.js +0 -172
- package/types/directive/list/list.d.ts +0 -4
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { getOrSetCacheData, JQLite } from "../shared/jqlite/jqlite";
|
|
2
2
|
import {
|
|
3
3
|
isUndefined,
|
|
4
|
-
forEach,
|
|
5
4
|
isObject,
|
|
6
5
|
isString,
|
|
7
6
|
isElement,
|
|
@@ -183,7 +182,7 @@ export function AnimateQueueProvider($animateProvider) {
|
|
|
183
182
|
if (postDigestCalled) {
|
|
184
183
|
fn();
|
|
185
184
|
} else {
|
|
186
|
-
$rootScope
|
|
185
|
+
$rootScope.$postUpdate(() => {
|
|
187
186
|
postDigestCalled = true;
|
|
188
187
|
fn();
|
|
189
188
|
});
|
|
@@ -195,29 +194,30 @@ export function AnimateQueueProvider($animateProvider) {
|
|
|
195
194
|
// compiled. The $templateRequest.totalPendingRequests variable keeps track of
|
|
196
195
|
// all of the remote templates being currently downloaded. If there are no
|
|
197
196
|
// templates currently downloading then the watcher will still fire anyway.
|
|
198
|
-
$rootScope["
|
|
197
|
+
$rootScope["templateRequest"] = $templateRequest;
|
|
199
198
|
const deregisterWatch = $rootScope.$watch(
|
|
200
199
|
"$templateRequest.totalPendingRequests",
|
|
201
200
|
(val) => {
|
|
202
|
-
if (val
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
201
|
+
if (val === 0) {
|
|
202
|
+
deregisterWatch();
|
|
203
|
+
$rootScope["$templateRequest"] = undefined;
|
|
204
|
+
// Now that all templates have been downloaded, $animate will wait until
|
|
205
|
+
// the post digest queue is empty before enabling animations. By having two
|
|
206
|
+
// calls to $postDigest calls we can ensure that the flag is enabled at the
|
|
207
|
+
// very end of the post digest queue. Since all of the animations in $animate
|
|
208
|
+
// use $postDigest, it's important that the code below executes at the end.
|
|
209
|
+
// This basically means that the page is fully downloaded and compiled before
|
|
210
|
+
// any animations are triggered.
|
|
211
|
+
$rootScope.$postUpdate(() => {
|
|
212
|
+
$rootScope.$postUpdate(() => {
|
|
213
|
+
// we check for null directly in the event that the application already called
|
|
214
|
+
// .enabled() with whatever arguments that it provided it with
|
|
215
|
+
if (animationsEnabled === null) {
|
|
216
|
+
animationsEnabled = true;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
219
|
});
|
|
220
|
-
}
|
|
220
|
+
}
|
|
221
221
|
},
|
|
222
222
|
);
|
|
223
223
|
|
|
@@ -598,7 +598,7 @@ export function AnimateQueueProvider($animateProvider) {
|
|
|
598
598
|
|
|
599
599
|
markElementAnimationState(node, PRE_DIGEST_STATE, newAnimation);
|
|
600
600
|
|
|
601
|
-
$rootScope
|
|
601
|
+
$rootScope.$postUpdate(() => {
|
|
602
602
|
// It is possible that the DOM nodes inside `originalElement` have been replaced. This can
|
|
603
603
|
// happen if the animated element is a transcluded clone and also has a `templateUrl`
|
|
604
604
|
// directive on it. Therefore, we must recreate `element` in order to interact with the
|
|
@@ -718,7 +718,7 @@ export function AnimateQueueProvider($animateProvider) {
|
|
|
718
718
|
|
|
719
719
|
function closeChildAnimations(node) {
|
|
720
720
|
const children = node.querySelectorAll(`[${NG_ANIMATE_ATTR_NAME}]`);
|
|
721
|
-
forEach(
|
|
721
|
+
children.forEach((child) => {
|
|
722
722
|
const state = parseInt(child.getAttribute(NG_ANIMATE_ATTR_NAME), 10);
|
|
723
723
|
const animationDetails = activeAnimationsLookup.get(child);
|
|
724
724
|
if (animationDetails) {
|
|
@@ -34,17 +34,13 @@ export function AnimateAsyncRunFactoryProvider() {
|
|
|
34
34
|
const INITIAL_STATE = 0;
|
|
35
35
|
const DONE_PENDING_STATE = 1;
|
|
36
36
|
const DONE_COMPLETE_STATE = 2;
|
|
37
|
-
let
|
|
37
|
+
let $$animateAsyncRun;
|
|
38
38
|
|
|
39
39
|
export function AnimateRunnerFactoryProvider() {
|
|
40
40
|
this.$get = [
|
|
41
|
-
"$q",
|
|
42
41
|
"$$animateAsyncRun",
|
|
43
|
-
|
|
44
|
-
function (q, animateAsyncRun, timeout) {
|
|
45
|
-
$q = q;
|
|
42
|
+
function (animateAsyncRun) {
|
|
46
43
|
$$animateAsyncRun = animateAsyncRun;
|
|
47
|
-
$timeout = timeout;
|
|
48
44
|
return AnimateRunner;
|
|
49
45
|
},
|
|
50
46
|
];
|
|
@@ -94,7 +90,7 @@ export class AnimateRunner {
|
|
|
94
90
|
|
|
95
91
|
const rafTick = $$animateAsyncRun();
|
|
96
92
|
const timeoutTick = (fn) => {
|
|
97
|
-
|
|
93
|
+
setTimeout(fn, 0, false);
|
|
98
94
|
};
|
|
99
95
|
|
|
100
96
|
this._doneCallbacks = [];
|
|
@@ -125,7 +121,7 @@ export class AnimateRunner {
|
|
|
125
121
|
getPromise() {
|
|
126
122
|
if (!this.promise) {
|
|
127
123
|
const self = this;
|
|
128
|
-
this.promise =
|
|
124
|
+
this.promise = new Promise((resolve, reject) => {
|
|
129
125
|
self.done((status) => {
|
|
130
126
|
if (status === false) {
|
|
131
127
|
reject();
|
|
@@ -82,7 +82,6 @@ describe("$animate", () => {
|
|
|
82
82
|
$animate.enabled(false);
|
|
83
83
|
expect(element[0].classList.contains("ng-hide")).toBeFalse();
|
|
84
84
|
$animate.addClass(element, "ng-hide");
|
|
85
|
-
$rootScope.$digest();
|
|
86
85
|
expect(element[0].classList.contains("ng-hide")).toBeTrue();
|
|
87
86
|
});
|
|
88
87
|
|
|
@@ -117,10 +116,8 @@ describe("$animate", () => {
|
|
|
117
116
|
$animate.enabled(false);
|
|
118
117
|
expect(rect[0].classList.contains("ng-hide")).toBeFalse();
|
|
119
118
|
$animate.addClass(rect, "ng-hide");
|
|
120
|
-
$rootScope.$digest();
|
|
121
119
|
expect(rect[0].classList.contains("ng-hide")).toBeTrue();
|
|
122
120
|
$animate.removeClass(rect, "ng-hide");
|
|
123
|
-
$rootScope.$digest();
|
|
124
121
|
expect(rect[0].classList.contains("ng-hide")).toBeFalse();
|
|
125
122
|
});
|
|
126
123
|
|
|
@@ -171,25 +168,21 @@ describe("$animate", () => {
|
|
|
171
168
|
$animate.addClass(element, "on", {
|
|
172
169
|
to: { color: "green" },
|
|
173
170
|
});
|
|
174
|
-
$rootScope.$digest();
|
|
175
171
|
assertColor("green");
|
|
176
172
|
|
|
177
173
|
$animate.setClass(element, "off", "on", {
|
|
178
174
|
to: { color: "black" },
|
|
179
175
|
});
|
|
180
|
-
$rootScope.$digest();
|
|
181
176
|
assertColor("black");
|
|
182
177
|
|
|
183
178
|
$animate.removeClass(element, "off", {
|
|
184
179
|
to: { color: "blue" },
|
|
185
180
|
});
|
|
186
|
-
$rootScope.$digest();
|
|
187
181
|
assertColor("blue");
|
|
188
182
|
|
|
189
183
|
$animate.leave(element, {
|
|
190
184
|
to: { color: "yellow" },
|
|
191
185
|
});
|
|
192
|
-
$rootScope.$digest();
|
|
193
186
|
assertColor("yellow");
|
|
194
187
|
|
|
195
188
|
function assertColor(color) {
|
|
@@ -205,8 +198,6 @@ describe("$animate", () => {
|
|
|
205
198
|
from: { color: "green" },
|
|
206
199
|
to: { borderColor: "purple" },
|
|
207
200
|
});
|
|
208
|
-
$rootScope.$digest();
|
|
209
|
-
|
|
210
201
|
const { style } = element[0];
|
|
211
202
|
expect(style.color).toBe("green");
|
|
212
203
|
expect(style.borderColor).toBe("purple");
|
|
@@ -217,8 +208,6 @@ describe("$animate", () => {
|
|
|
217
208
|
|
|
218
209
|
$animate.addClass(element, "ng-hide");
|
|
219
210
|
$animate.removeClass(element, "ng-hide");
|
|
220
|
-
$rootScope.$digest();
|
|
221
|
-
|
|
222
211
|
expect(element[0].classList.contains("ng-hide")).toBeFalse();
|
|
223
212
|
});
|
|
224
213
|
|
|
@@ -227,8 +216,6 @@ describe("$animate", () => {
|
|
|
227
216
|
|
|
228
217
|
$animate.removeClass(element, "ng-hide");
|
|
229
218
|
$animate.addClass(element, "ng-hide");
|
|
230
|
-
$rootScope.$digest();
|
|
231
|
-
|
|
232
219
|
expect(element[0].classList.contains("ng-hide")).toBeTrue();
|
|
233
220
|
});
|
|
234
221
|
|
|
@@ -338,7 +325,6 @@ describe("$animate", () => {
|
|
|
338
325
|
|
|
339
326
|
expect(() => {
|
|
340
327
|
fn();
|
|
341
|
-
$rootScope.$digest();
|
|
342
328
|
}).not.toThrow();
|
|
343
329
|
|
|
344
330
|
const optionsArg = captureSpy.calls.mostRecent().args[2];
|
|
@@ -353,8 +339,6 @@ describe("$animate", () => {
|
|
|
353
339
|
|
|
354
340
|
$animate.enter(element1, $rootElement, null, { addClass: " " });
|
|
355
341
|
$animate.enter(element2, $rootElement, null, { addClass: "valid-name" });
|
|
356
|
-
$rootScope.$digest();
|
|
357
|
-
|
|
358
342
|
expect(element2[0].classList.contains("valid-name")).toBeTruthy();
|
|
359
343
|
});
|
|
360
344
|
|
|
@@ -375,7 +359,6 @@ describe("$animate", () => {
|
|
|
375
359
|
const runner = $animate.enter(element, parent, null, copiedOptions);
|
|
376
360
|
expect(copiedOptions).toEqual(initialOptions);
|
|
377
361
|
|
|
378
|
-
$rootScope.$digest();
|
|
379
362
|
expect(copiedOptions).toEqual(initialOptions);
|
|
380
363
|
});
|
|
381
364
|
|
|
@@ -418,7 +401,6 @@ describe("$animate", () => {
|
|
|
418
401
|
$animate.removeClass(element, "test-class1");
|
|
419
402
|
$animate.addClass(element, "test-class2");
|
|
420
403
|
$animate.setClass(element, "test-class3", "test-class4");
|
|
421
|
-
$rootScope.$digest();
|
|
422
404
|
expect(element[0].classList.contains("test-class1")).toBeFalse();
|
|
423
405
|
expect(element[0].classList.contains("test-class2")).toBeTrue();
|
|
424
406
|
expect(element[0].classList.contains("test-class3")).toBeTrue();
|
|
@@ -443,7 +425,6 @@ describe("$animate", () => {
|
|
|
443
425
|
$animate.addClass(element, "test1");
|
|
444
426
|
$animate.removeClass(element, "test2");
|
|
445
427
|
|
|
446
|
-
$rootScope.$digest();
|
|
447
428
|
element = JQLite('<p class="test4">test</p>');
|
|
448
429
|
|
|
449
430
|
$rootScope.$apply(() => {
|
|
@@ -486,8 +467,6 @@ describe("$animate", () => {
|
|
|
486
467
|
$animate.addClass(target, "test-class2");
|
|
487
468
|
$animate.setClass(target, "test-class3", "test-class4");
|
|
488
469
|
|
|
489
|
-
$rootScope.$digest();
|
|
490
|
-
|
|
491
470
|
expect(target[0].classList.contains("test-class2")).toBeTrue();
|
|
492
471
|
expect(target[0].classList.contains("test-class3")).toBeTrue();
|
|
493
472
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JQLite } from "../shared/jqlite/jqlite";
|
|
2
|
-
import {
|
|
2
|
+
import { mergeClasses } from "../shared/utils";
|
|
3
3
|
import {
|
|
4
4
|
NG_ANIMATE_CLASSNAME,
|
|
5
5
|
PREPARE_CLASS_SUFFIX,
|
|
@@ -203,7 +203,7 @@ export function AnimationProvider() {
|
|
|
203
203
|
// were apart of the same postDigest flush call.
|
|
204
204
|
if (animationQueue.length > 1) return runner;
|
|
205
205
|
|
|
206
|
-
$rootScope
|
|
206
|
+
$rootScope.$postUpdate(() => {
|
|
207
207
|
const animations = [];
|
|
208
208
|
animationQueue.forEach((entry) => {
|
|
209
209
|
// the element was destroyed early on which removed the runner
|
|
@@ -326,7 +326,7 @@ export function AnimationProvider() {
|
|
|
326
326
|
? [node]
|
|
327
327
|
: node.querySelectorAll(SELECTOR);
|
|
328
328
|
const anchors = [];
|
|
329
|
-
forEach(
|
|
329
|
+
items.forEach((node) => {
|
|
330
330
|
const attr = node.getAttribute(NG_ANIMATE_REF_ATTR);
|
|
331
331
|
if (attr && attr.length) {
|
|
332
332
|
anchors.push(node);
|
|
@@ -338,7 +338,7 @@ export function AnimationProvider() {
|
|
|
338
338
|
function groupAnimations(animations) {
|
|
339
339
|
const preparedAnimations = [];
|
|
340
340
|
const refLookup = {};
|
|
341
|
-
forEach(
|
|
341
|
+
animations.forEach((animation, index) => {
|
|
342
342
|
const { element } = animation;
|
|
343
343
|
const node = getDomNode(element);
|
|
344
344
|
const { event } = animation;
|
package/src/animations/shared.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isString, minErr, extend } from "../shared/utils.js";
|
|
2
2
|
import { JQLite } from "../shared/jqlite/jqlite.js";
|
|
3
3
|
import { ASTType } from "../core/parse/ast-type.js";
|
|
4
4
|
|
|
@@ -262,12 +262,12 @@ export function resolveElementClasses(existing, toAdd, toRemove) {
|
|
|
262
262
|
existing = splitClassesToLookup(existing);
|
|
263
263
|
|
|
264
264
|
toAdd = splitClassesToLookup(toAdd);
|
|
265
|
-
|
|
265
|
+
Object.keys(toAdd).forEach((key) => {
|
|
266
266
|
flags[key] = ADD_CLASS;
|
|
267
267
|
});
|
|
268
268
|
|
|
269
269
|
toRemove = splitClassesToLookup(toRemove);
|
|
270
|
-
|
|
270
|
+
Object.keys(toRemove).forEach((key) => {
|
|
271
271
|
flags[key] = flags[key] === ADD_CLASS ? null : REMOVE_CLASS;
|
|
272
272
|
});
|
|
273
273
|
|
|
@@ -276,7 +276,7 @@ export function resolveElementClasses(existing, toAdd, toRemove) {
|
|
|
276
276
|
removeClass: "",
|
|
277
277
|
};
|
|
278
278
|
|
|
279
|
-
forEach(
|
|
279
|
+
Object.entries(flags).forEach(([klass, val]) => {
|
|
280
280
|
var prop, allow;
|
|
281
281
|
if (val === ADD_CLASS) {
|
|
282
282
|
prop = "addClass";
|
|
@@ -295,17 +295,19 @@ export function resolveElementClasses(existing, toAdd, toRemove) {
|
|
|
295
295
|
|
|
296
296
|
function splitClassesToLookup(classes) {
|
|
297
297
|
if (isString(classes)) {
|
|
298
|
-
classes = classes.split(" ");
|
|
298
|
+
classes = classes.trim().split(" ");
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
const obj = {};
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
302
|
+
if (classes) {
|
|
303
|
+
classes.forEach((klass) => {
|
|
304
|
+
// sometimes the split leaves empty string values
|
|
305
|
+
// incase extra spaces were applied to the options
|
|
306
|
+
if (klass.length) {
|
|
307
|
+
obj[klass] = true;
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
309
311
|
return obj;
|
|
310
312
|
}
|
|
311
313
|
|
package/src/binding.spec.js
CHANGED
package/src/core/cache/cache.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
export const EXPANDO = "
|
|
10
|
+
export const EXPANDO = "ng";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Expando cache for adding properties to DOM nodes with JavaScript.
|
|
@@ -17,31 +17,4 @@ export const EXPANDO = "ngId";
|
|
|
17
17
|
*
|
|
18
18
|
* @type {Map<number, ExpandoStore>}
|
|
19
19
|
*/
|
|
20
|
-
export const CACHE = new
|
|
21
|
-
get(target, prop, receiver) {
|
|
22
|
-
if (prop === "size") {
|
|
23
|
-
return target.size;
|
|
24
|
-
}
|
|
25
|
-
if (typeof target[prop] === "function") {
|
|
26
|
-
return function (...args) {
|
|
27
|
-
return target[prop].apply(target, args);
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
return Reflect.get(target, prop, receiver);
|
|
31
|
-
},
|
|
32
|
-
set(target, prop, value, receiver) {
|
|
33
|
-
return Reflect.set(target, prop, value, receiver);
|
|
34
|
-
},
|
|
35
|
-
deleteProperty(target, prop) {
|
|
36
|
-
return Reflect.deleteProperty(target, prop);
|
|
37
|
-
},
|
|
38
|
-
has(target, prop) {
|
|
39
|
-
return Reflect.has(target, prop);
|
|
40
|
-
},
|
|
41
|
-
ownKeys(target) {
|
|
42
|
-
return Reflect.ownKeys(target);
|
|
43
|
-
},
|
|
44
|
-
getOwnPropertyDescriptor(target, prop) {
|
|
45
|
-
return Reflect.getOwnPropertyDescriptor(target, prop);
|
|
46
|
-
},
|
|
47
|
-
});
|
|
20
|
+
export const CACHE = new Map();
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { getBooleanAttrName } from "../../shared/jqlite/jqlite";
|
|
2
2
|
import {
|
|
3
|
-
forEach,
|
|
4
3
|
isString,
|
|
5
4
|
snakeCase,
|
|
6
5
|
isUndefined,
|
|
@@ -179,8 +178,8 @@ export class Attributes {
|
|
|
179
178
|
|
|
180
179
|
// fire observers
|
|
181
180
|
const { $$observers } = this;
|
|
182
|
-
if ($$observers) {
|
|
183
|
-
|
|
181
|
+
if ($$observers && $$observers[observer]) {
|
|
182
|
+
$$observers[observer].forEach((fn) => {
|
|
184
183
|
try {
|
|
185
184
|
fn(value);
|
|
186
185
|
} catch (e) {
|