@angular-wave/angular.ts 0.0.52 → 0.0.54

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.
@@ -9,7 +9,6 @@ describe("binding", () => {
9
9
  $rootScope,
10
10
  $compile,
11
11
  $exceptionHandler,
12
- $document,
13
12
  errors = [];
14
13
 
15
14
  function childNode(element, index) {
@@ -27,7 +26,6 @@ describe("binding", () => {
27
26
  $rootScope = $injector.get("$rootScope");
28
27
  $compile = $injector.get("$compile");
29
28
  $exceptionHandler = $injector.get("$exceptionHandler");
30
- $document = $injector.get("$document");
31
29
  this.compileToHtml = function (content) {
32
30
  let html;
33
31
  content = JQLite(content);
@@ -1,3 +1,5 @@
1
+ import { addInlineStyles } from "./helpers";
2
+
1
3
  /**
2
4
  * @ngdoc service
3
5
  * @name $animateCss
@@ -14,6 +16,12 @@ export function CoreAnimateCssProvider() {
14
16
  this.$get = [
15
17
  "$$AnimateRunner",
16
18
  ($$AnimateRunner) =>
19
+ /**
20
+ *
21
+ * @param {import("../../shared/jqlite/jqlite").JQLite} element
22
+ * @param {*} initialOptions
23
+ * @returns
24
+ */
17
25
  function (element, initialOptions) {
18
26
  // all of the animation functions should create
19
27
  // a copy of the options data, however, if a
@@ -32,17 +40,16 @@ export function CoreAnimateCssProvider() {
32
40
  }
33
41
 
34
42
  if (options.from) {
35
- //element.css(options.from);
43
+ addInlineStyles(element[0], options.from);
36
44
  options.from = null;
37
45
  }
38
46
 
39
47
  let closed;
40
48
  const runner = new $$AnimateRunner();
41
- return {
42
- start: run,
43
- end: run,
44
- };
45
49
 
50
+ /**
51
+ * @returns {$$AnimateRunner}
52
+ */
46
53
  function run() {
47
54
  requestAnimationFrame(() => {
48
55
  applyAnimationContents();
@@ -54,6 +61,9 @@ export function CoreAnimateCssProvider() {
54
61
  return runner;
55
62
  }
56
63
 
64
+ /**
65
+ * @returns {void}
66
+ */
57
67
  function applyAnimationContents() {
58
68
  if (options.addClass) {
59
69
  element[0].classList.add(options.addClass);
@@ -64,10 +74,15 @@ export function CoreAnimateCssProvider() {
64
74
  options.removeClass = null;
65
75
  }
66
76
  if (options.to) {
67
- //element.css(options.to);
77
+ addInlineStyles(element[0], options.to);
68
78
  options.to = null;
69
79
  }
70
80
  }
81
+
82
+ return {
83
+ start: run,
84
+ end: run,
85
+ };
71
86
  },
72
87
  ];
73
88
  }
@@ -8,6 +8,7 @@ import {
8
8
  } from "../../shared/utils";
9
9
  import { JQLite } from "../../shared/jqlite/jqlite";
10
10
  import { NG_ANIMATE_CLASSNAME } from "../../animations/shared";
11
+ import { addInlineStyles } from "./helpers";
11
12
 
12
13
  const $animateMinErr = minErr("$animate");
13
14
 
@@ -86,10 +87,10 @@ export function CoreAnimateQueueProvider() {
86
87
 
87
88
  options = options || {};
88
89
  if (options.from) {
89
- //element.css(options.from);
90
+ addInlineStyles(element[0], options.from);
90
91
  }
91
92
  if (options.to) {
92
- //element.css(options.to);
93
+ addInlineStyles(element[0], options.to);
93
94
  }
94
95
 
95
96
  if (options.addClass || options.removeClass) {
@@ -150,7 +151,7 @@ export function CoreAnimateQueueProvider() {
150
151
  toRemove.split(" ").forEach((css) => elm.classList.remove(css));
151
152
  }
152
153
  if (toAdd) {
153
- elm.className += ` ${toAdd}`;
154
+ toAdd.split(" ").forEach((css) => elm.classList.add(css));
154
155
  }
155
156
  });
156
157
  postDigestQueue.delete(element);