@angular-wave/angular.ts 0.15.1 → 0.15.2

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.
@@ -1,4 +1,4 @@
1
- /* Version: 0.15.1 - December 21, 2025 17:06:17 */
1
+ /* Version: 0.15.2 - December 24, 2025 03:47:35 */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
4
4
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -796,18 +796,6 @@
796
796
  return isString(json) ? JSON.parse(json) : json;
797
797
  }
798
798
 
799
- /**
800
- * @param {Date} date
801
- * @param {number} minutes
802
- */
803
- function addDateMinutes(date, minutes) {
804
- const newDate = new Date(date.getTime());
805
-
806
- newDate.setMinutes(newDate.getMinutes() + minutes);
807
-
808
- return newDate;
809
- }
810
-
811
799
  /**
812
800
  * Parses an escaped url query string into key-value pairs.
813
801
  * @param {string} keyValue
@@ -9941,7 +9929,7 @@
9941
9929
 
9942
9930
  let linkNode = $compileNode._getAny();
9943
9931
 
9944
- if (scope.$$destroyed) {
9932
+ if (scope._destroyed) {
9945
9933
  continue;
9946
9934
  }
9947
9935
 
@@ -10008,7 +9996,7 @@
10008
9996
  ) {
10009
9997
  let childBoundTranscludeFn = boundTranscludeFn;
10010
9998
 
10011
- if (scope.$$destroyed) {
9999
+ if (scope._destroyed) {
10012
10000
  return;
10013
10001
  }
10014
10002
 
@@ -12930,9 +12918,6 @@
12930
12918
  };
12931
12919
  }
12932
12920
 
12933
- // Regex code was initially obtained from SO prior to modification: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime#answer-3143231
12934
- const ISO_DATE_REGEXP =
12935
- /^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/;
12936
12921
  // See valid URLs in RFC3987 (http://tools.ietf.org/html/rfc3987)
12937
12922
  // Note: We are being more lenient, because browsers are too.
12938
12923
  // 1. Scheme
@@ -12980,35 +12965,14 @@
12980
12965
 
12981
12966
  const inputType = {
12982
12967
  text: textInputType,
12983
- date: createDateInputType(
12984
- "date",
12985
- DATE_REGEXP,
12986
- createDateParser(DATE_REGEXP, ["yyyy", "MM", "dd"]),
12987
- ),
12988
- "datetime-local": createDateInputType(
12968
+ date: createStringDateInputType("date", DATE_REGEXP),
12969
+ "datetime-local": createStringDateInputType(
12989
12970
  "datetimelocal",
12990
12971
  DATETIMELOCAL_REGEXP,
12991
- createDateParser(DATETIMELOCAL_REGEXP, [
12992
- "yyyy",
12993
- "MM",
12994
- "dd",
12995
- "HH",
12996
- "mm",
12997
- "ss",
12998
- "sss",
12999
- ]),
13000
- ),
13001
- time: createDateInputType(
13002
- "time",
13003
- TIME_REGEXP,
13004
- createDateParser(TIME_REGEXP, ["HH", "mm", "ss", "sss"]),
13005
- ),
13006
- week: createDateInputType("week", WEEK_REGEXP, weekParser),
13007
- month: createDateInputType(
13008
- "month",
13009
- MONTH_REGEXP,
13010
- createDateParser(MONTH_REGEXP, ["yyyy", "MM"]),
13011
12972
  ),
12973
+ time: createStringDateInputType("time", TIME_REGEXP),
12974
+ week: createStringDateInputType("week", WEEK_REGEXP),
12975
+ month: createStringDateInputType("month", MONTH_REGEXP),
13012
12976
  number: numberInputType,
13013
12977
  url: urlInputType,
13014
12978
  email: emailInputType,
@@ -13137,318 +13101,56 @@
13137
13101
  };
13138
13102
  }
13139
13103
 
13140
- function weekParser(isoWeek, existingDate) {
13141
- if (isDate(isoWeek)) {
13142
- return isoWeek;
13143
- }
13144
-
13145
- function getFirstThursdayOfYear(year) {
13146
- // 0 = index of January
13147
- const dayOfWeekOnFirst = new Date(year, 0, 1).getDay();
13148
-
13149
- // 4 = index of Thursday (+1 to account for 1st = 5)
13150
- // 11 = index of *next* Thursday (+1 account for 1st = 12)
13151
- return new Date(
13152
- year,
13153
- 0,
13154
- // eslint-disable-next-line no-magic-numbers
13155
- (dayOfWeekOnFirst <= 4 ? 5 : 12) - dayOfWeekOnFirst,
13156
- );
13157
- }
13158
-
13159
- if (isString(isoWeek)) {
13160
- WEEK_REGEXP.lastIndex = 0;
13161
- const parts = WEEK_REGEXP.exec(isoWeek);
13162
-
13163
- if (parts) {
13164
- const year = +parts[1];
13165
-
13166
- const week = +parts[2];
13167
-
13168
- let hours = 0;
13169
-
13170
- let minutes = 0;
13171
-
13172
- let seconds = 0;
13173
-
13174
- let milliseconds = 0;
13175
-
13176
- const firstThurs = getFirstThursdayOfYear(year);
13177
-
13178
- const DAYS = 7;
13179
-
13180
- const addDays = (week - 1) * DAYS;
13181
-
13182
- if (existingDate) {
13183
- hours = existingDate.getHours();
13184
- minutes = existingDate.getMinutes();
13185
- seconds = existingDate.getSeconds();
13186
- milliseconds = existingDate.getMilliseconds();
13187
- }
13188
-
13189
- return new Date(
13190
- year,
13191
- 0,
13192
- firstThurs.getDate() + addDays,
13193
- hours,
13194
- minutes,
13195
- seconds,
13196
- milliseconds,
13197
- );
13198
- }
13199
- }
13200
-
13201
- return NaN;
13202
- }
13203
-
13204
- function createDateParser(regexp, mapping) {
13205
- return function (iso, previousDate) {
13206
- let parts;
13207
-
13208
- let map;
13209
-
13210
- if (isDate(iso)) {
13211
- return iso;
13212
- }
13213
-
13214
- if (isString(iso)) {
13215
- // When a date is JSON'ified to wraps itself inside of an extra
13216
- // set of double quotes. This makes the date parsing code unable
13217
- // to match the date string and parse it as a date.
13218
- if (iso.charAt(0) === '"' && iso.charAt(iso.length - 1) === '"') {
13219
- iso = iso.substring(1, iso.length - 1);
13220
- }
13221
-
13222
- if (ISO_DATE_REGEXP.test(iso)) {
13223
- return new Date(iso);
13224
- }
13225
- regexp.lastIndex = 0;
13226
- parts = regexp.exec(iso);
13227
-
13228
- if (parts) {
13229
- parts.shift();
13230
-
13231
- if (previousDate) {
13232
- map = {
13233
- yyyy: previousDate.getFullYear(),
13234
- MM: previousDate.getMonth() + 1,
13235
- dd: previousDate.getDate(),
13236
- HH: previousDate.getHours(),
13237
- mm: previousDate.getMinutes(),
13238
- ss: previousDate.getSeconds(),
13239
- sss: previousDate.getMilliseconds() / 1000,
13240
- };
13241
- } else {
13242
- map = { yyyy: 1970, MM: 1, dd: 1, HH: 0, mm: 0, ss: 0, sss: 0 };
13243
- }
13244
-
13245
- Object.entries(parts).forEach(([index, part]) => {
13246
- if (index < mapping.length) {
13247
- map[mapping[index]] = +part;
13248
- }
13249
- });
13250
-
13251
- const date = new Date(
13252
- map.yyyy,
13253
- map.MM - 1,
13254
- map.dd,
13255
- map.HH,
13256
- map.mm,
13257
- map.ss || 0,
13258
- map.sss * 1000 || 0,
13259
- );
13260
-
13261
- if (map.yyyy < 100) {
13262
- // In the constructor, 2-digit years map to 1900-1999.
13263
- // Use `setFullYear()` to set the correct year.
13264
- date.setFullYear(map.yyyy);
13265
- }
13266
-
13267
- return date;
13268
- }
13269
- }
13270
-
13271
- return NaN;
13272
- };
13273
- }
13274
-
13275
- const MONTH_INPUT_FORMAT = /\b\d{4}-(0[1-9]|1[0-2])\b/;
13276
-
13277
- function createDateInputType(type, regexp, parseDate) {
13278
- return function dynamicDateInputType(
13279
- scope,
13280
- element,
13281
- attr,
13282
- ctrl,
13283
- $filter,
13284
- $parse,
13285
- ) {
13286
- badInputChecker(scope, element, attr, ctrl, type);
13104
+ /**
13105
+ * @param {string} type
13106
+ * @param {RegExp} regexp
13107
+ * @returns {*}
13108
+ */
13109
+ function createStringDateInputType(type, regexp) {
13110
+ return function stringDateInputType(scope, element, attr, ctrl, $parse) {
13287
13111
  baseInputType(scope, element, attr, ctrl);
13288
- let previousDate;
13289
-
13290
13112
  ctrl.$parsers.push((value) => {
13291
13113
  if (ctrl.$isEmpty(value)) return null;
13292
13114
 
13293
- if (regexp.test(value)) {
13294
- // Do not convert for native HTML
13295
- if (["month", "week", "datetimelocal", "time", "date"].includes(type)) {
13296
- return value;
13297
- }
13115
+ if (regexp.test(value)) return value;
13298
13116
 
13299
- // Note: We cannot read ctrl.$modelValue, as there might be a different
13300
- // parser/formatter in the processing chain so that the model
13301
- // contains some different data format!
13302
- return parseDateAndConvertTimeZoneToLocal(value, previousDate);
13303
- }
13304
13117
  ctrl.$$parserName = type;
13305
13118
 
13306
13119
  return undefined;
13307
13120
  });
13308
13121
 
13309
- ctrl.$formatters.push(function (value) {
13310
- if (value && !isString(value)) {
13311
- throw ngModelMinErr("datefmt", "Expected `{0}` to be a String", value);
13312
- }
13313
-
13314
- if (type === "month") {
13315
- if (isNullOrUndefined(value)) {
13316
- return "";
13317
- }
13318
-
13319
- if (!MONTH_INPUT_FORMAT.test(value)) {
13320
- throw ngModelMinErr(
13321
- "datefmt",
13322
- "Expected month `{0}` to be a 'YYYY-DD'",
13323
- value,
13324
- );
13325
- }
13326
- }
13122
+ ctrl.$formatters.push((value) => {
13123
+ if (ctrl.$isEmpty(value)) return "";
13327
13124
 
13328
- if (type === "week") {
13329
- if (isNullOrUndefined(value)) {
13330
- return "";
13331
- }
13332
-
13333
- if (!WEEK_REGEXP.test(value)) {
13334
- throw ngModelMinErr(
13335
- "datefmt",
13336
- "Expected week `{0}` to be a 'yyyy-Www'",
13337
- value,
13338
- );
13339
- }
13340
- }
13341
-
13342
- if (type === "datetimelocal") {
13343
- if (isNullOrUndefined(value)) {
13344
- return "";
13345
- }
13346
-
13347
- if (!DATETIMELOCAL_REGEXP.test(value)) {
13348
- throw ngModelMinErr(
13349
- "datefmt",
13350
- "Expected week `{0}` to be a in date time format. See: https://developer.mozilla.org/en-US/docs/Web/HTML/Date_and_time_formats#local_date_and_time_strings",
13351
- value,
13352
- );
13353
- }
13125
+ if (!isString(value)) {
13126
+ throw ngModelMinErr("datefmt", "Expected `{0}` to be a string", value);
13354
13127
  }
13355
13128
 
13356
13129
  return value;
13357
-
13358
- // if (isValidDate(value)) {
13359
- // previousDate = value;
13360
- // const timezone = ctrl.$options.getOption("timezone");
13361
-
13362
- // if (timezone) {
13363
- // previousTimezone = timezone;
13364
- // previousDate = convertTimezoneToLocal(previousDate, timezone, true);
13365
- // }
13366
-
13367
- // return value;
13368
- // }
13369
- // previousDate = null;
13370
- // previousTimezone = null;
13371
- // return "";
13372
13130
  });
13373
13131
 
13132
+ // Optional min/max
13374
13133
  if (isDefined(attr.min) || attr.ngMin) {
13375
- let minVal = attr.min || $parse(attr.ngMin)(scope);
13134
+ let minVal = attr.min || $parse?.(attr.ngMin)(scope);
13376
13135
 
13377
- let parsedMinVal = parseObservedDateValue(deProxy(minVal));
13378
-
13379
- ctrl.$validators.min = function (value) {
13380
- if (type === "month") {
13381
- return (
13382
- isUndefined(parsedMinVal) ||
13383
- parseDate(value) >= parseDate(parsedMinVal)
13384
- );
13385
- }
13386
-
13387
- return (
13388
- !isValidDate(value) ||
13389
- isUndefined(parsedMinVal) ||
13390
- parseDate(value) >= parsedMinVal
13391
- );
13392
- };
13136
+ ctrl.$validators.min = (_modelValue, viewValue) =>
13137
+ ctrl.$isEmpty(viewValue) || viewValue >= minVal;
13393
13138
  attr.$observe("min", (val) => {
13394
- if (val !== minVal) {
13395
- parsedMinVal = parseObservedDateValue(val);
13396
- minVal = val;
13397
- ctrl.$validate();
13398
- }
13139
+ minVal = val;
13140
+ ctrl.$validate();
13399
13141
  });
13400
13142
  }
13401
13143
 
13402
13144
  if (isDefined(attr.max) || attr.ngMax) {
13403
- let maxVal = attr.max || $parse(attr.ngMax)(scope);
13404
-
13405
- let parsedMaxVal = parseObservedDateValue(deProxy(maxVal));
13406
-
13407
- ctrl.$validators.max = function (value) {
13408
- if (type === "month") {
13409
- return (
13410
- isUndefined(parsedMaxVal) ||
13411
- parseDate(value) <= parseDate(parsedMaxVal)
13412
- );
13413
- }
13145
+ let maxVal = attr.max || $parse?.(attr.ngMax)(scope);
13414
13146
 
13415
- return (
13416
- !isValidDate(value) ||
13417
- isUndefined(parsedMaxVal) ||
13418
- parseDate(value) <= parsedMaxVal
13419
- );
13420
- };
13147
+ ctrl.$validators.max = (_modelValue, viewValue) =>
13148
+ ctrl.$isEmpty(viewValue) || viewValue <= maxVal;
13421
13149
  attr.$observe("max", (val) => {
13422
- if (val !== maxVal) {
13423
- parsedMaxVal = parseObservedDateValue(val);
13424
- maxVal = val;
13425
- ctrl.$validate();
13426
- }
13150
+ maxVal = val;
13151
+ ctrl.$validate();
13427
13152
  });
13428
13153
  }
13429
-
13430
- function isValidDate(value) {
13431
- // Invalid Date: getTime() returns NaN
13432
- return value && !(value.getTime && Number.isNaN(value.getTime()));
13433
- }
13434
-
13435
- function parseObservedDateValue(val) {
13436
- return isDefined(val) && !isDate(val)
13437
- ? parseDateAndConvertTimeZoneToLocal(val) || undefined
13438
- : val;
13439
- }
13440
-
13441
- function parseDateAndConvertTimeZoneToLocal(value, previousDateParam) {
13442
- const timezone = ctrl.$options.getOption("timezone");
13443
-
13444
- let parsedDate = parseDate(value, previousDateParam);
13445
-
13446
- if (!Number.isNaN(parsedDate) && timezone) {
13447
- parsedDate = convertTimezoneToLocal(parsedDate, timezone);
13448
- }
13449
-
13450
- return parsedDate;
13451
- }
13452
13154
  };
13453
13155
  }
13454
13156
 
@@ -13573,7 +13275,7 @@
13573
13275
  return (value - stepBase) % step === 0;
13574
13276
  }
13575
13277
 
13576
- function numberInputType(scope, element, attr, ctrl, $filter, $parse) {
13278
+ function numberInputType(scope, element, attr, ctrl, $parse) {
13577
13279
  badInputChecker(scope, element, attr, ctrl, "number");
13578
13280
  numberFormatterParser(ctrl);
13579
13281
  baseInputType(scope, element, attr, ctrl);
@@ -13912,7 +13614,7 @@
13912
13614
  return fallback;
13913
13615
  }
13914
13616
 
13915
- function checkboxInputType(scope, element, attr, ctrl, $filter, $parse) {
13617
+ function checkboxInputType(scope, element, attr, ctrl, $parse) {
13916
13618
  const trueValue = parseConstantExpr(
13917
13619
  $parse,
13918
13620
  scope,
@@ -13951,14 +13653,13 @@
13951
13653
  ctrl.$parsers.push((value) => (value ? trueValue : falseValue));
13952
13654
  }
13953
13655
 
13954
- inputDirective.$inject = [$injectTokens._filter, $injectTokens._parse];
13656
+ inputDirective.$inject = [$injectTokens._parse];
13955
13657
 
13956
13658
  /**
13957
- * @param {ng.FilterFactory} $filter
13958
13659
  * @param {ng.ParseService} $parse
13959
13660
  * @returns {ng.Directive}
13960
13661
  */
13961
- function inputDirective($filter, $parse) {
13662
+ function inputDirective($parse) {
13962
13663
  return {
13963
13664
  restrict: "E",
13964
13665
  require: ["?ngModel"],
@@ -13970,7 +13671,6 @@
13970
13671
  element,
13971
13672
  attr,
13972
13673
  ctrls[0],
13973
- $filter,
13974
13674
  $parse,
13975
13675
  );
13976
13676
  }
@@ -13982,47 +13682,18 @@
13982
13682
  /**
13983
13683
  * @returns {ng.Directive}
13984
13684
  */
13985
- function hiddenInputBrowserCacheDirective() {
13986
- const valueProperty = {
13987
- configurable: true,
13988
- enumerable: false,
13989
- get() {
13990
- return this.getAttribute("value") || "";
13991
- },
13992
- set(val) {
13993
- this.setAttribute("value", val);
13994
- },
13995
- };
13996
-
13685
+ function hiddenInputDirective() {
13997
13686
  return {
13998
13687
  restrict: "E",
13999
- priority: 200,
14000
13688
  compile(_, attr) {
14001
- if (attr.type?.toLowerCase() !== "hidden") {
14002
- return undefined;
14003
- }
13689
+ if (attr.type?.toLowerCase() !== "hidden") return undefined;
14004
13690
 
14005
- const res = {
13691
+ return {
14006
13692
  pre(_scope, element) {
14007
- const node = element;
14008
-
14009
- // Support: Edge
14010
- // Moving the DOM around prevents autofillling
14011
- if (node.parentNode) {
14012
- node.parentNode.insertBefore(node, node.nextSibling);
14013
- }
14014
-
14015
- // Support: FF, IE
14016
- // Avoiding direct assignment to .value prevents autofillling
14017
- if (Object.defineProperty) {
14018
- Object.defineProperty(node, "value", valueProperty);
14019
- }
14020
-
14021
- return undefined;
13693
+ /** @type {HTMLInputElement} */ (element).value =
13694
+ element.getAttribute("value") ?? "";
14022
13695
  },
14023
13696
  };
14024
-
14025
- return res;
14026
13697
  },
14027
13698
  };
14028
13699
  }
@@ -14065,40 +13736,6 @@
14065
13736
  };
14066
13737
  }
14067
13738
 
14068
- /**
14069
- * @param {Date} date
14070
- * @param {any} timezone
14071
- * @param {undefined} [reverse]
14072
- */
14073
- function convertTimezoneToLocal(date, timezone, reverse) {
14074
- const doReverse = 1;
14075
-
14076
- const dateTimezoneOffset = date.getTimezoneOffset();
14077
-
14078
- const timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
14079
-
14080
- return addDateMinutes(
14081
- date,
14082
- doReverse * (timezoneOffset - dateTimezoneOffset),
14083
- );
14084
- }
14085
-
14086
- const MS_PER_MINUTE = 60_000; // 60,000 ms in a minute
14087
-
14088
- /**
14089
- * @param {any} timezone
14090
- * @param {number} [fallback]
14091
- * @returns {number}
14092
- */
14093
- function timezoneToOffset(timezone, fallback) {
14094
- const requestedTimezoneOffset =
14095
- Date.parse(`Jan 01, 1970 00:00:00 ${timezone}`) / MS_PER_MINUTE;
14096
-
14097
- return isNumberNaN(requestedTimezoneOffset)
14098
- ? (fallback ?? 0)
14099
- : requestedTimezoneOffset;
14100
- }
14101
-
14102
13739
  scriptDirective.$inject = [$injectTokens._templateCache];
14103
13740
 
14104
13741
  /**
@@ -15073,6 +14710,7 @@
15073
14710
 
15074
14711
  ngHideDirective.$inject = [$injectTokens._animate];
15075
14712
  /**
14713
+ * @param {ng.AnimateService} $animate
15076
14714
  * @returns {ng.Directive}
15077
14715
  */
15078
14716
  function ngHideDirective($animate) {
@@ -15270,9 +14908,9 @@
15270
14908
  if (src) {
15271
14909
  // set the 2nd param to true to ignore the template request error so that the inner
15272
14910
  // contents and scope can be cleaned up.
15273
- await $templateRequest(src, true).then(
14911
+ await $templateRequest(src).then(
15274
14912
  (response) => {
15275
- if (scope.$$destroyed) return;
14913
+ if (scope._destroyed) return;
15276
14914
 
15277
14915
  if (thisChangeId !== changeCounter) return;
15278
14916
  const newScope = scope.$new();
@@ -15304,7 +14942,7 @@
15304
14942
  scope.$eval(onloadExp);
15305
14943
  },
15306
14944
  (err) => {
15307
- if (scope.$$destroyed) return;
14945
+ if (scope._destroyed) return;
15308
14946
 
15309
14947
  if (thisChangeId === changeCounter) {
15310
14948
  cleanupLastIncludeContent();
@@ -22442,7 +22080,7 @@
22442
22080
  *
22443
22081
  * @param {Object} target - The object to be wrapped in a proxy.
22444
22082
  * @param {Scope} [context] - The context for the handler, used to track listeners.
22445
- * @returns {Scope} - A proxy that intercepts operations on the target object,
22083
+ * @returns {Scope|Object} - A proxy that intercepts operations on the target object,
22446
22084
  * or the original value if the target is not an object.
22447
22085
  */
22448
22086
  function createScope(target = {}, context) {
@@ -22498,7 +22136,8 @@
22498
22136
  target instanceof Promise ||
22499
22137
  target instanceof HTMLCollection ||
22500
22138
  target instanceof NodeList ||
22501
- target instanceof Event
22139
+ target instanceof Event ||
22140
+ target instanceof Date
22502
22141
  ) {
22503
22142
  return true;
22504
22143
  }
@@ -22533,20 +22172,17 @@
22533
22172
  /** @type {Map<string, Array<import('./interface.ts').Listener>>} Watch listeners */
22534
22173
  this.watchers = context ? context.watchers : new Map();
22535
22174
 
22536
- /** @type {Map<String, Function[]>} Event listeners */
22537
- this.$$listeners = new Map();
22538
-
22539
- /** @type {Map<string, Array<import('./interface.ts').Listener>>} Watch listeners from other proxies */
22540
- this.foreignListeners = context ? context.foreignListeners : new Map();
22175
+ /** @private @type {Map<String, Function[]>} Event listeners */
22176
+ this._listeners = new Map();
22541
22177
 
22542
- /** @type {Set<Proxy<ng.Scope>>} */
22543
- this.foreignProxies = context ? context.foreignProxies : new Set();
22178
+ /** @private @type {Map<string, Array<import('./interface.ts').Listener>>} Watch listeners from other proxies */
22179
+ this._foreignListeners = context ? context._foreignListeners : new Map();
22544
22180
 
22545
- /** @type {WeakMap<Object, Array<string>>} */
22546
- this.objectListeners = context ? context.objectListeners : new WeakMap();
22181
+ /** @private @type {Set<Proxy<ng.Scope>>} */
22182
+ this._foreignProxies = context ? context._foreignProxies : new Set();
22547
22183
 
22548
- /** @type {Map<Function, {oldValue: any, fn: Function}>} */
22549
- this.functionListeners = context ? context.functionListeners : new Map();
22184
+ /** @private @type {WeakMap<Object, Array<string>>} */
22185
+ this._objectListeners = context ? context._objectListeners : new WeakMap();
22550
22186
 
22551
22187
  /** @type {Proxy<Scope>} Current proxy being operated on */
22552
22188
  this.$proxy = null;
@@ -22581,40 +22217,39 @@
22581
22217
  ? null
22582
22218
  : context;
22583
22219
 
22584
- this.filters = [];
22585
-
22586
- /** @type {boolean} */
22587
- this.$$destroyed = false;
22220
+ /** @ignore @type {boolean} */
22221
+ this._destroyed = false;
22588
22222
 
22589
- this.scheduled = [];
22223
+ /** @private @type {import("./interface.ts").Listener[]} A list of scheduled Event listeners */
22224
+ this._scheduled = [];
22590
22225
 
22591
22226
  this.$scopename = undefined;
22592
22227
 
22593
22228
  /** @private */
22594
22229
  this.propertyMap = {
22595
- $watch: this.$watch.bind(this),
22596
- $new: this.$new.bind(this),
22597
- $newIsolate: this.$newIsolate.bind(this),
22598
- $destroy: this.$destroy.bind(this),
22599
- $flushQueue: this.$flushQueue.bind(this),
22600
- $eval: this.$eval.bind(this),
22601
22230
  $apply: this.$apply.bind(this),
22602
- $postUpdate: this.$postUpdate.bind(this),
22603
- $isRoot: this.#isRoot.bind(this),
22604
- $on: this.$on.bind(this),
22605
- $emit: this.$emit.bind(this),
22606
22231
  $broadcast: this.$broadcast.bind(this),
22607
- $transcluded: this.$transcluded.bind(this),
22232
+ $children: this.$children,
22233
+ $destroy: this.$destroy.bind(this),
22234
+ $emit: this.$emit.bind(this),
22235
+ $eval: this.$eval.bind(this),
22236
+ $flushQueue: this.$flushQueue.bind(this),
22237
+ $getById: this.$getById.bind(this),
22608
22238
  $handler: /** @type {Scope} */ (this),
22239
+ $id: this.$id,
22240
+ $isRoot: this.#isRoot.bind(this),
22609
22241
  $merge: this.$merge.bind(this),
22610
- $getById: this.$getById.bind(this),
22611
- $searchByName: this.$searchByName.bind(this),
22612
- $proxy: this.$proxy,
22242
+ $new: this.$new.bind(this),
22243
+ $newIsolate: this.$newIsolate.bind(this),
22244
+ $on: this.$on.bind(this),
22613
22245
  $parent: this.$parent,
22246
+ $postUpdate: this.$postUpdate.bind(this),
22247
+ $proxy: this.$proxy,
22614
22248
  $root: this.$root,
22615
- $children: this.$children,
22616
- $id: this.$id,
22617
22249
  $scopename: this.$scopename,
22250
+ $searchByName: this.$searchByName.bind(this),
22251
+ $transcluded: this.$transcluded.bind(this),
22252
+ $watch: this.$watch.bind(this),
22618
22253
  };
22619
22254
  }
22620
22255
 
@@ -22674,18 +22309,18 @@
22674
22309
  this.#scheduleListener(listeners);
22675
22310
  }
22676
22311
 
22677
- const foreignListeners = this.foreignListeners.get(property);
22312
+ const _foreignListeners = this._foreignListeners.get(property);
22678
22313
 
22679
- if (foreignListeners) {
22680
- this.#scheduleListener(foreignListeners);
22314
+ if (_foreignListeners) {
22315
+ this.#scheduleListener(_foreignListeners);
22681
22316
  }
22682
22317
  }
22683
22318
 
22684
- if (this.objectListeners.get(target[property])) {
22685
- this.objectListeners.delete(target[property]);
22319
+ if (this._objectListeners.get(target[property])) {
22320
+ this._objectListeners.delete(target[property]);
22686
22321
  }
22687
22322
  target[property] = createScope(value, this);
22688
- this.objectListeners.set(target[property], [property]);
22323
+ this._objectListeners.set(target[property], [property]);
22689
22324
 
22690
22325
  return true;
22691
22326
  }
@@ -22706,10 +22341,10 @@
22706
22341
  this.#scheduleListener(listeners);
22707
22342
  }
22708
22343
 
22709
- const foreignListeners = this.foreignListeners.get(property);
22344
+ const _foreignListeners = this._foreignListeners.get(property);
22710
22345
 
22711
- if (foreignListeners) {
22712
- this.#scheduleListener(foreignListeners);
22346
+ if (_foreignListeners) {
22347
+ this.#scheduleListener(_foreignListeners);
22713
22348
  }
22714
22349
 
22715
22350
  this.#checkeListenersForAllKeys(value);
@@ -22762,8 +22397,8 @@
22762
22397
  }
22763
22398
 
22764
22399
  if (isArray(target)) {
22765
- if (this.objectListeners.has(proxy) && property !== "length") {
22766
- const keyList = this.objectListeners.get(proxy);
22400
+ if (this._objectListeners.has(proxy) && property !== "length") {
22401
+ const keyList = this._objectListeners.get(proxy);
22767
22402
 
22768
22403
  for (let i = 0, l = keyList.length; i < l; i++) {
22769
22404
  const currentListeners = this.watchers.get(keyList[i]);
@@ -22779,7 +22414,7 @@
22779
22414
  return true;
22780
22415
  } else {
22781
22416
  if (isUndefined(target[property]) && isProxy(value)) {
22782
- this.foreignProxies.add(/** @type {Proxy<ng.Scope>} */ (value));
22417
+ this._foreignProxies.add(/** @type {Proxy<ng.Scope>} */ (value));
22783
22418
  target[property] = value;
22784
22419
 
22785
22420
  if (!this.watchers.has(property)) {
@@ -22800,8 +22435,8 @@
22800
22435
 
22801
22436
  // Handle the case where we need to start observing object after a watcher has been set
22802
22437
  if (isUndefined(oldValue) && isObject(target[property])) {
22803
- if (!this.objectListeners.has(target[property])) {
22804
- this.objectListeners.set(target[property], [property]);
22438
+ if (!this._objectListeners.has(target[property])) {
22439
+ this._objectListeners.set(target[property], [property]);
22805
22440
  }
22806
22441
  const keyList = keys(value);
22807
22442
 
@@ -22864,14 +22499,14 @@
22864
22499
  });
22865
22500
  }
22866
22501
 
22867
- let foreignListeners = this.foreignListeners.get(property);
22502
+ let _foreignListeners = this._foreignListeners.get(property);
22868
22503
 
22869
- if (!foreignListeners && this.$parent?.foreignListeners) {
22870
- foreignListeners = this.$parent.foreignListeners.get(property);
22504
+ if (!_foreignListeners && this.$parent?._foreignListeners) {
22505
+ _foreignListeners = this.$parent._foreignListeners.get(property);
22871
22506
  }
22872
22507
 
22873
- if (foreignListeners) {
22874
- let scheduled = foreignListeners;
22508
+ if (_foreignListeners) {
22509
+ let scheduled = _foreignListeners;
22875
22510
 
22876
22511
  // filter for repeaters
22877
22512
  const hashKey = this.$target._hashKey;
@@ -22879,8 +22514,8 @@
22879
22514
  if (hashKey) {
22880
22515
  scheduled = [];
22881
22516
 
22882
- for (let i = 0, l = foreignListeners.length; i < l; i++) {
22883
- const listener = foreignListeners[i];
22517
+ for (let i = 0, l = _foreignListeners.length; i < l; i++) {
22518
+ const listener = _foreignListeners[i];
22884
22519
 
22885
22520
  if (listener.originalTarget._hashKey === hashKey) {
22886
22521
  scheduled.push(listener);
@@ -22894,15 +22529,15 @@
22894
22529
  }
22895
22530
  }
22896
22531
 
22897
- if (this.objectListeners.has(proxy) && property !== "length") {
22898
- const keyList = this.objectListeners.get(proxy);
22532
+ if (this._objectListeners.has(proxy) && property !== "length") {
22533
+ const keyList = this._objectListeners.get(proxy);
22899
22534
 
22900
22535
  for (let i = 0, l = keyList.length; i < l; i++) {
22901
22536
  const key = keyList[i];
22902
22537
 
22903
22538
  const listeners = this.watchers.get(key);
22904
22539
 
22905
- if (listeners && this.scheduled !== listeners) {
22540
+ if (listeners && this._scheduled !== listeners) {
22906
22541
  this.#scheduleListener(listeners);
22907
22542
  }
22908
22543
  }
@@ -22942,8 +22577,8 @@
22942
22577
  isArray(target) &&
22943
22578
  ["pop", "shift", "unshift"].includes(/** @type { string } */ (property))
22944
22579
  ) {
22945
- if (this.objectListeners.has(proxy)) {
22946
- const keyList = this.objectListeners.get(proxy);
22580
+ if (this._objectListeners.has(proxy)) {
22581
+ const keyList = this._objectListeners.get(proxy);
22947
22582
 
22948
22583
  for (let i = 0, l = keyList.length; i < l; i++) {
22949
22584
  const key = keyList[i];
@@ -22951,13 +22586,13 @@
22951
22586
  const listeners = this.watchers.get(key);
22952
22587
 
22953
22588
  if (listeners) {
22954
- this.scheduled = listeners;
22589
+ this._scheduled = listeners;
22955
22590
  }
22956
22591
  }
22957
22592
  }
22958
22593
 
22959
22594
  if (property === "unshift") {
22960
- this.#scheduleListener(this.scheduled);
22595
+ this.#scheduleListener(this._scheduled);
22961
22596
  }
22962
22597
  }
22963
22598
 
@@ -22982,8 +22617,8 @@
22982
22617
  this.#scheduleListener(listeners);
22983
22618
  }
22984
22619
 
22985
- if (this.objectListeners.has(this.$proxy)) {
22986
- const keyList = this.objectListeners.get(this.$proxy);
22620
+ if (this._objectListeners.has(this.$proxy)) {
22621
+ const keyList = this._objectListeners.get(this.$proxy);
22987
22622
 
22988
22623
  for (let i = 0, l = keyList.length; i < l; i++) {
22989
22624
  const key = keyList[i];
@@ -22994,9 +22629,9 @@
22994
22629
  }
22995
22630
  }
22996
22631
 
22997
- if (this.scheduled) {
22998
- this.#scheduleListener(this.scheduled);
22999
- this.scheduled = [];
22632
+ if (this._scheduled) {
22633
+ this.#scheduleListener(this._scheduled);
22634
+ this._scheduled = [];
23000
22635
  }
23001
22636
 
23002
22637
  return true;
@@ -23004,8 +22639,8 @@
23004
22639
 
23005
22640
  delete target[property];
23006
22641
 
23007
- if (this.objectListeners.has(this.$proxy)) {
23008
- const keyList = this.objectListeners.get(this.$proxy);
22642
+ if (this._objectListeners.has(this.$proxy)) {
22643
+ const keyList = this._objectListeners.get(this.$proxy);
23009
22644
 
23010
22645
  for (let i = 0, l = keyList.length; i < l; i++) {
23011
22646
  const key = keyList[i];
@@ -23247,7 +22882,7 @@
23247
22882
  watchProp.split(".").slice(0, -1).join("."),
23248
22883
  )(/** @type {Scope} */ (listener.originalTarget));
23249
22884
 
23250
- if (potentialProxy && this.foreignProxies.has(potentialProxy)) {
22885
+ if (potentialProxy && this._foreignProxies.has(potentialProxy)) {
23251
22886
  potentialProxy.$handler.#registerForeignKey(key, listener);
23252
22887
  potentialProxy.$handler.#scheduleListener([listener]);
23253
22888
 
@@ -23330,7 +22965,7 @@
23330
22965
  const listenerObject = listener.watchFn(this.$target);
23331
22966
 
23332
22967
  if (isObject(listenerObject)) {
23333
- this.objectListeners.set(listenerObject, [key]);
22968
+ this._objectListeners.set(listenerObject, [key]);
23334
22969
  }
23335
22970
 
23336
22971
  if (keySet.length > 0) {
@@ -23424,10 +23059,10 @@
23424
23059
 
23425
23060
  /** @internal **/
23426
23061
  #registerForeignKey(key, listener) {
23427
- if (this.foreignListeners.has(key)) {
23428
- this.foreignListeners.get(key).push(listener);
23062
+ if (this._foreignListeners.has(key)) {
23063
+ this._foreignListeners.get(key).push(listener);
23429
23064
  } else {
23430
- this.foreignListeners.set(key, [listener]);
23065
+ this._foreignListeners.set(key, [listener]);
23431
23066
  }
23432
23067
  }
23433
23068
 
@@ -23452,7 +23087,7 @@
23452
23087
  }
23453
23088
 
23454
23089
  // #deregisterForeignKey(key, id) {
23455
- // const listenerList = this.foreignListeners.get(key);
23090
+ // const listenerList = this._foreignListeners.get(key);
23456
23091
  // if (!listenerList) return false;
23457
23092
 
23458
23093
  // const index = listenerList.findIndex((x) => x.id === id);
@@ -23460,9 +23095,9 @@
23460
23095
 
23461
23096
  // listenerList.splice(index, 1);
23462
23097
  // if (listenerList.length) {
23463
- // this.foreignListeners.set(key, listenerList);
23098
+ // this._foreignListeners.set(key, listenerList);
23464
23099
  // } else {
23465
- // this.foreignListeners.delete(key);
23100
+ // this._foreignListeners.delete(key);
23466
23101
  // }
23467
23102
  // return true;
23468
23103
  // }
@@ -23522,11 +23157,11 @@
23522
23157
  * @returns {(function(): void)|*}
23523
23158
  */
23524
23159
  $on(name, listener) {
23525
- let namedListeners = this.$$listeners.get(name);
23160
+ let namedListeners = this._listeners.get(name);
23526
23161
 
23527
23162
  if (!namedListeners) {
23528
23163
  namedListeners = [];
23529
- this.$$listeners.set(name, namedListeners);
23164
+ this._listeners.set(name, namedListeners);
23530
23165
  }
23531
23166
  namedListeners.push(listener);
23532
23167
 
@@ -23537,7 +23172,7 @@
23537
23172
  namedListeners.splice(indexOfListener, 1);
23538
23173
 
23539
23174
  if (namedListeners.length === 0) {
23540
- this.$$listeners.delete(name);
23175
+ this._listeners.delete(name);
23541
23176
  }
23542
23177
  }
23543
23178
  };
@@ -23573,7 +23208,7 @@
23573
23208
  */
23574
23209
  #eventHelper({ name, event, broadcast }, ...args) {
23575
23210
  if (!broadcast) {
23576
- if (!this.$$listeners.has(name)) {
23211
+ if (!this._listeners.has(name)) {
23577
23212
  if (this.$parent) {
23578
23213
  return this.$parent.$handler.#eventHelper(
23579
23214
  { name, event, broadcast },
@@ -23605,7 +23240,7 @@
23605
23240
 
23606
23241
  const listenerArgs = concat([event], [event].concat(args), 1);
23607
23242
 
23608
- const listeners = this.$$listeners.get(name);
23243
+ const listeners = this._listeners.get(name);
23609
23244
 
23610
23245
  if (listeners) {
23611
23246
  let { length } = listeners;
@@ -23672,7 +23307,7 @@
23672
23307
  }
23673
23308
 
23674
23309
  $destroy() {
23675
- if (this.$$destroyed) return;
23310
+ if (this._destroyed) return;
23676
23311
 
23677
23312
  this.$broadcast("$destroy");
23678
23313
 
@@ -23703,8 +23338,8 @@
23703
23338
  }
23704
23339
  }
23705
23340
 
23706
- this.$$listeners.clear();
23707
- this.$$destroyed = true;
23341
+ this._listeners.clear();
23342
+ this._destroyed = true;
23708
23343
  }
23709
23344
 
23710
23345
  /**
@@ -23786,31 +23421,23 @@
23786
23421
  * @returns {ng.Scope|undefined}
23787
23422
  */
23788
23423
  $searchByName(name) {
23789
- /**
23790
- * @param {ng.Scope} scope
23791
- * @param {string} nameParam
23792
- * @returns {ng.Scope|undefined}
23793
- */
23794
- function getByName(scope, nameParam) {
23795
- if (scope.$scopename === nameParam) {
23796
- return scope;
23797
- } else {
23798
- let res = undefined;
23424
+ const stack = [this.$root];
23799
23425
 
23800
- for (const child of scope.$children) {
23801
- const found = getByName(child, nameParam);
23426
+ while (stack.length) {
23427
+ const scope = stack.pop();
23802
23428
 
23803
- if (found) {
23804
- res = found;
23805
- break;
23806
- }
23807
- }
23429
+ if (scope.$scopename === name) {
23430
+ return scope;
23431
+ }
23808
23432
 
23809
- return res;
23433
+ if (scope.$children?.length) {
23434
+ for (let i = scope.$children.length - 1; i >= 0; i--) {
23435
+ stack.push(scope.$children[i]);
23436
+ }
23810
23437
  }
23811
23438
  }
23812
23439
 
23813
- return getByName(this.$root, name);
23440
+ return undefined;
23814
23441
  }
23815
23442
  }
23816
23443
 
@@ -23862,146 +23489,65 @@
23862
23489
  return ids;
23863
23490
  }
23864
23491
 
23865
- const $templateRequestMinErr = minErr("$templateRequest");
23866
-
23867
23492
  /**
23868
- * Used to configure the options passed to the {@link $http} service when making a template request.
23493
+ * Provider for the `$templateRequest` service.
23869
23494
  *
23870
- * For example, it can be used for specifying the "Accept" header that is sent to the server, when
23871
- * requesting a template.
23495
+ * Fetches templates via HTTP and caches them in `$templateCache`.
23496
+ * Templates are assumed trusted. This provider allows configuring
23497
+ * per-request `$http` options such as headers, timeout, or transform functions.
23872
23498
  */
23873
- function TemplateRequestProvider() {
23874
- let httpOptions;
23875
-
23876
- /**
23877
- * The options to be passed to the {@link $http} service when making the request.
23878
- * You can use this to override options such as the "Accept" header for template requests.
23879
- * The {@link $templateRequest} will set the `cache` and the `transformResponse` properties of the
23880
- * options if not overridden here.
23881
- *
23882
- * @param {string=} val new value for the {@link $http} options.
23883
- * @returns {string|TemplateRequestProvider} Returns the {@link $http} options when used as getter and self if used as setter.
23884
- */
23885
- this.httpOptions = function (val) {
23886
- if (val) {
23887
- httpOptions = val;
23499
+ class TemplateRequestProvider {
23500
+ /** @type {ng.RequestShortcutConfig|undefined} */
23501
+ httpOptions;
23888
23502
 
23889
- return this;
23890
- }
23891
-
23892
- return httpOptions;
23893
- };
23894
-
23895
- /**
23896
- * The `$templateRequest` service runs security checks then downloads the provided template using
23897
- * `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request
23898
- * fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the
23899
- * exception can be thwarted by setting the 2nd parameter of the function to true). Note that the
23900
- * contents of `$templateCache` are trusted, so the call to `$sce.getTrustedUrl(tpl)` is omitted
23901
- * when `tpl` is of type string and `$templateCache` has the matching entry.
23902
- *
23903
- * If you want to pass custom options to the `$http` service, such as setting the Accept header you
23904
- * can configure this via {@link $templateRequestProvider#httpOptions}.
23905
- *
23906
- * `$templateRequest` is used internally by {@link $compile}, {@link ngRoute.$route}, and directives such
23907
- * as {@link ngInclude} to download and cache templates.
23908
- *
23909
- * 3rd party modules should use `$templateRequest` if their services or directives are loading
23910
- * templates.
23911
- *
23912
- * @param {string} tpl The HTTP request template URL
23913
- * @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty
23914
- *
23915
- * @return {Promise} a promise for the HTTP response data of the given URL.
23916
- *
23917
- * @property {number} totalPendingRequests total amount of pending template requests being downloaded.
23918
- */
23919
- this.$get = [
23920
- $injectTokens._exceptionHandler,
23503
+ /** @returns {Array} DI tokens for Angular.ts injection */
23504
+ $get = [
23921
23505
  $injectTokens._templateCache,
23922
23506
  $injectTokens._http,
23923
- $injectTokens._sce,
23924
23507
  /**
23925
- *
23926
- * @param {ng.ExceptionHandlerService} $exceptionHandler
23927
23508
  * @param {ng.TemplateCacheService} $templateCache
23928
23509
  * @param {ng.HttpService} $http
23929
- * @param {*} $sce
23930
23510
  * @returns {ng.TemplateRequestService}
23931
23511
  */
23932
- function ($exceptionHandler, $templateCache, $http, $sce) {
23933
- function handleRequestFn(tpl, ignoreRequestError) {
23934
- handleRequestFn.totalPendingRequests++;
23935
-
23936
- // We consider the template cache holds only trusted templates, so
23937
- // there's no need to go through adding the template again to the trusted
23938
- // resources for keys that already are included in there. This also makes
23939
- // AngularTS accept any script directive, no matter its name. However, we
23940
- // still need to unwrap trusted types.
23941
-
23942
- if (!isString(tpl) || !$templateCache.has(tpl)) {
23943
- try {
23944
- tpl = $sce.getTrustedResourceUrl(tpl);
23945
-
23946
- if (!tpl) {
23947
- return Promise.reject("Template not found");
23948
- }
23949
- } catch (err) {
23950
- return Promise.reject(err.message);
23951
- }
23952
- }
23953
-
23954
- let transformResponse =
23955
- $http.defaults && $http.defaults.transformResponse;
23512
+ ($templateCache, $http) => {
23513
+ /**
23514
+ * Fetch a template via HTTP and cache it.
23515
+ *
23516
+ * @param {string} templateUrl URL of the template
23517
+ * @returns {Promise<string>} Resolves with template content
23518
+ */
23519
+ const fetchTemplate = (templateUrl) => {
23520
+ // Filter out default transformResponse for template requests
23521
+ let transformResponse = $http.defaults?.transformResponse ?? null;
23956
23522
 
23957
23523
  if (isArray(transformResponse)) {
23958
- transformResponse = transformResponse.filter(function (transformer) {
23959
- return transformer !== defaultHttpResponseTransform;
23960
- });
23524
+ transformResponse = transformResponse.filter(
23525
+ (x) => x !== defaultHttpResponseTransform,
23526
+ );
23961
23527
  } else if (transformResponse === defaultHttpResponseTransform) {
23962
23528
  transformResponse = null;
23963
23529
  }
23964
23530
 
23965
- return $http
23966
- .get(
23967
- tpl,
23968
- extend(
23969
- {
23970
- cache: $templateCache,
23971
- transformResponse,
23972
- },
23973
- httpOptions,
23974
- ),
23975
- )
23976
- .finally(function () {
23977
- handleRequestFn.totalPendingRequests--;
23978
- })
23979
- .then(function (response) {
23980
- $templateCache.set(tpl, response.data);
23981
-
23982
- return response.data;
23983
- }, handleError);
23984
-
23985
- function handleError(resp) {
23986
- if (!ignoreRequestError) {
23987
- resp = $templateRequestMinErr(
23988
- "tpload",
23989
- "Failed to load template: {0} (HTTP status: {1} {2})",
23990
- tpl,
23991
- resp.status,
23992
- resp.statusText,
23993
- );
23994
-
23995
- $exceptionHandler(resp);
23996
- }
23531
+ /** @type {ng.RequestShortcutConfig} */
23532
+ const config = extend(
23533
+ {
23534
+ cache: $templateCache,
23535
+ transformResponse,
23536
+ },
23537
+ this.httpOptions || {},
23538
+ );
23997
23539
 
23998
- return Promise.reject(resp);
23999
- }
24000
- }
23540
+ return $http.get(templateUrl, config).then(
23541
+ (response) => {
23542
+ $templateCache.set(templateUrl, response.data);
24001
23543
 
24002
- handleRequestFn.totalPendingRequests = 0;
23544
+ return response.data;
23545
+ },
23546
+ (resp) => Promise.reject(resp),
23547
+ );
23548
+ };
24003
23549
 
24004
- return handleRequestFn;
23550
+ return fetchTemplate;
24005
23551
  },
24006
23552
  ];
24007
23553
  }
@@ -24341,7 +23887,7 @@
24341
23887
  const src = attrs.ngMessagesInclude || attrs.src;
24342
23888
 
24343
23889
  $templateRequest(src).then((html) => {
24344
- if ($scope.$$destroyed) return;
23890
+ if ($scope._destroyed) return;
24345
23891
 
24346
23892
  if (isString(html) && !html.trim()) ; else {
24347
23893
  // Non-empty template - compile and link
@@ -38819,6 +38365,7 @@
38819
38365
  */
38820
38366
  function ngChannelDirective($eventBus) {
38821
38367
  return {
38368
+ scope: false,
38822
38369
  link: (scope, element, attrs) => {
38823
38370
  const channel = attrs.ngChannel;
38824
38371
 
@@ -38833,6 +38380,8 @@
38833
38380
  }
38834
38381
  } else if (isString(value)) {
38835
38382
  element.innerHTML = value;
38383
+ } else {
38384
+ element.innerHTML = value.toString();
38836
38385
  }
38837
38386
  },
38838
38387
  );
@@ -40367,7 +39916,7 @@
40367
39916
  ngScope: ngScopeDirective,
40368
39917
  })
40369
39918
  .directive({
40370
- input: hiddenInputBrowserCacheDirective,
39919
+ input: hiddenInputDirective,
40371
39920
  ngAnimateSwap: ngAnimateSwapDirective,
40372
39921
  ngAnimateChildren: $$AnimateChildrenDirective,
40373
39922
  // aria directives
@@ -40460,9 +40009,12 @@
40460
40009
  const moduleRegistry = {};
40461
40010
 
40462
40011
  class Angular extends EventTarget {
40463
- constructor() {
40012
+ constructor(submodule = false) {
40464
40013
  super();
40465
40014
 
40015
+ /** @private @type {boolean} */
40016
+ this._submodule = submodule;
40017
+
40466
40018
  /** @private @type {!Array<string|any>} */
40467
40019
  this._bootsrappedModules = [];
40468
40020
 
@@ -40476,7 +40028,7 @@
40476
40028
  * @public
40477
40029
  * @type {string} `version` from `package.json`
40478
40030
  */
40479
- this.version = "0.15.1"; //inserted via rollup plugin
40031
+ this.version = "0.15.2"; //inserted via rollup plugin
40480
40032
 
40481
40033
  /**
40482
40034
  * Gets the controller instance for a given element, if exists. Defaults to "ngControllerController"
@@ -40506,7 +40058,9 @@
40506
40058
  /** @type {any} */ (this.$t)[i] = i;
40507
40059
  });
40508
40060
 
40509
- window.angular = this;
40061
+ if (!submodule) {
40062
+ window.angular = this;
40063
+ }
40510
40064
  registerNgModule(this);
40511
40065
  }
40512
40066