@angular/core 5.2.0-rc.0 → 5.2.3

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,6 +1,6 @@
1
1
  /**
2
- * @license Angular v5.2.0-rc.0
3
- * (c) 2010-2017 Google, Inc. https://angular.io/
2
+ * @license Angular v5.2.3
3
+ * (c) 2010-2018 Google, Inc. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
  (function (global, factory) {
@@ -44,8 +44,8 @@ var __assign = Object.assign || function __assign(t) {
44
44
  };
45
45
 
46
46
  /**
47
- * @license Angular v5.2.0-rc.0
48
- * (c) 2010-2017 Google, Inc. https://angular.io/
47
+ * @license Angular v5.2.3
48
+ * (c) 2010-2018 Google, Inc. https://angular.io/
49
49
  * License: MIT
50
50
  */
51
51
  /**
@@ -755,7 +755,7 @@ var Version = /** @class */ (function () {
755
755
  /**
756
756
  * \@stable
757
757
  */
758
- var VERSION = new Version('5.2.0-rc.0');
758
+ var VERSION = new Version('5.2.3');
759
759
 
760
760
  /**
761
761
  * @fileoverview added by tsickle
@@ -7157,10 +7157,10 @@ function devModeEqual(a, b) {
7157
7157
  }
7158
7158
  /**
7159
7159
  * Indicates that the result of a {\@link Pipe} transformation has changed even though the
7160
- * reference
7161
- * has not changed.
7160
+ * reference has not changed.
7162
7161
  *
7163
- * The wrapped value will be unwrapped by change detection, and the unwrapped value will be stored.
7162
+ * Wrapped values are unwrapped automatically during the change detection, and the unwrapped value
7163
+ * is stored.
7164
7164
  *
7165
7165
  * Example:
7166
7166
  *
@@ -7175,50 +7175,53 @@ function devModeEqual(a, b) {
7175
7175
  * \@stable
7176
7176
  */
7177
7177
  var WrappedValue = /** @class */ (function () {
7178
- function WrappedValue(wrapped) {
7179
- this.wrapped = wrapped;
7178
+ function WrappedValue(value) {
7179
+ this.wrapped = value;
7180
7180
  }
7181
+ /** Creates a wrapped value. */
7181
7182
  /**
7183
+ * Creates a wrapped value.
7182
7184
  * @param {?} value
7183
7185
  * @return {?}
7184
7186
  */
7185
7187
  WrappedValue.wrap = /**
7188
+ * Creates a wrapped value.
7186
7189
  * @param {?} value
7187
7190
  * @return {?}
7188
7191
  */
7189
7192
  function (value) { return new WrappedValue(value); };
7190
- return WrappedValue;
7191
- }());
7192
- /**
7193
- * Helper class for unwrapping WrappedValue s
7194
- */
7195
- var ValueUnwrapper = /** @class */ (function () {
7196
- function ValueUnwrapper() {
7197
- this.hasWrappedValue = false;
7198
- }
7199
7193
  /**
7194
+ * Returns the underlying value of a wrapped value.
7195
+ * Returns the given `value` when it is not wrapped.
7196
+ **/
7197
+ /**
7198
+ * Returns the underlying value of a wrapped value.
7199
+ * Returns the given `value` when it is not wrapped.
7200
+ *
7200
7201
  * @param {?} value
7201
7202
  * @return {?}
7202
7203
  */
7203
- ValueUnwrapper.prototype.unwrap = /**
7204
+ WrappedValue.unwrap = /**
7205
+ * Returns the underlying value of a wrapped value.
7206
+ * Returns the given `value` when it is not wrapped.
7207
+ *
7204
7208
  * @param {?} value
7205
7209
  * @return {?}
7206
7210
  */
7207
- function (value) {
7208
- if (value instanceof WrappedValue) {
7209
- this.hasWrappedValue = true;
7210
- return value.wrapped;
7211
- }
7212
- return value;
7213
- };
7211
+ function (value) { return WrappedValue.isWrapped(value) ? value.wrapped : value; };
7212
+ /** Returns true if `value` is a wrapped value. */
7214
7213
  /**
7214
+ * Returns true if `value` is a wrapped value.
7215
+ * @param {?} value
7215
7216
  * @return {?}
7216
7217
  */
7217
- ValueUnwrapper.prototype.reset = /**
7218
+ WrappedValue.isWrapped = /**
7219
+ * Returns true if `value` is a wrapped value.
7220
+ * @param {?} value
7218
7221
  * @return {?}
7219
7222
  */
7220
- function () { this.hasWrappedValue = false; };
7221
- return ValueUnwrapper;
7223
+ function (value) { return value instanceof WrappedValue; };
7224
+ return WrappedValue;
7222
7225
  }());
7223
7226
  /**
7224
7227
  * Represents a basic change from a previous to a new value.
@@ -9852,13 +9855,10 @@ function tokenKey(token) {
9852
9855
  * @return {?}
9853
9856
  */
9854
9857
  function unwrapValue(view, nodeIdx, bindingIdx, value) {
9855
- if (value instanceof WrappedValue) {
9856
- value = value.wrapped;
9858
+ if (WrappedValue.isWrapped(value)) {
9859
+ value = WrappedValue.unwrap(value);
9857
9860
  var /** @type {?} */ globalBindingIdx = view.def.nodes[nodeIdx].bindingIndex + bindingIdx;
9858
- var /** @type {?} */ oldValue = view.oldValues[globalBindingIdx];
9859
- if (oldValue instanceof WrappedValue) {
9860
- oldValue = oldValue.wrapped;
9861
- }
9861
+ var /** @type {?} */ oldValue = WrappedValue.unwrap(view.oldValues[globalBindingIdx]);
9862
9862
  view.oldValues[globalBindingIdx] = new WrappedValue(oldValue);
9863
9863
  }
9864
9864
  return value;
@@ -9938,7 +9938,8 @@ function checkAndUpdateBinding(view, def, bindingIdx, value) {
9938
9938
  function checkBindingNoChanges(view, def, bindingIdx, value) {
9939
9939
  var /** @type {?} */ oldValue = view.oldValues[def.bindingIndex + bindingIdx];
9940
9940
  if ((view.state & 1 /* BeforeFirstCheck */) || !devModeEqual(oldValue, value)) {
9941
- throw expressionChangedAfterItHasBeenCheckedError(Services.createDebugContext(view, def.nodeIndex), oldValue, value, (view.state & 1 /* BeforeFirstCheck */) !== 0);
9941
+ var /** @type {?} */ bindingName = def.bindings[bindingIdx].name;
9942
+ throw expressionChangedAfterItHasBeenCheckedError(Services.createDebugContext(view, def.nodeIndex), bindingName + ": " + oldValue, bindingName + ": " + value, (view.state & 1 /* BeforeFirstCheck */) !== 0);
9942
9943
  }
9943
9944
  }
9944
9945
  /**
@@ -12640,10 +12641,7 @@ function updateProp(view, providerData, def, bindingIdx, value, changes) {
12640
12641
  providerData.instance[propName] = value;
12641
12642
  if (def.flags & 524288 /* OnChanges */) {
12642
12643
  changes = changes || {};
12643
- var /** @type {?} */ oldValue = view.oldValues[def.bindingIndex + bindingIdx];
12644
- if (oldValue instanceof WrappedValue) {
12645
- oldValue = oldValue.wrapped;
12646
- }
12644
+ var /** @type {?} */ oldValue = WrappedValue.unwrap(view.oldValues[def.bindingIndex + bindingIdx]);
12647
12645
  var /** @type {?} */ binding_1 = def.bindings[bindingIdx];
12648
12646
  changes[/** @type {?} */ ((binding_1.nonMinifiedName))] =
12649
12647
  new SimpleChange(oldValue, value, (view.state & 2 /* FirstCheck */) !== 0);
@@ -16561,6 +16559,10 @@ var bindingIndex;
16561
16559
  * 2nd index is: context for function
16562
16560
  */
16563
16561
  var cleanup;
16562
+ /**
16563
+ * Index in the data array at which view hooks begin to be stored.
16564
+ */
16565
+ var viewHookStartIndex;
16564
16566
  /**
16565
16567
  * Swap the current state with a new state.
16566
16568
  *
@@ -16578,10 +16580,8 @@ function enterView(newViewState, host) {
16578
16580
  data = newViewState.data;
16579
16581
  bindingIndex = newViewState.bindingStartIndex || 0;
16580
16582
  ngStaticData = newViewState.ngStaticData;
16581
- if (creationMode = !data) {
16582
- // Absence of data implies creationMode.
16583
- (/** @type {?} */ (newViewState)).data = data = [];
16584
- }
16583
+ creationMode = newViewState.creationMode;
16584
+ viewHookStartIndex = newViewState.viewHookStartIndex;
16585
16585
  cleanup = newViewState.cleanup;
16586
16586
  renderer = newViewState.renderer;
16587
16587
  if (host != null) {
@@ -16594,8 +16594,13 @@ function enterView(newViewState, host) {
16594
16594
  /**
16595
16595
  * Used in lieu of enterView to make it clear when we are exiting a child view. This makes
16596
16596
  * the direction of traversal (up or down the view tree) a bit clearer.
16597
+ * @param {?} newViewState
16598
+ * @return {?}
16597
16599
  */
16598
- var leaveView = /** @type {?} */ (enterView);
16600
+ function leaveView(newViewState) {
16601
+ executeViewHooks();
16602
+ enterView(newViewState, null);
16603
+ }
16599
16604
  /**
16600
16605
  * @param {?} viewId
16601
16606
  * @param {?} renderer
@@ -16609,15 +16614,16 @@ function createViewState(viewId, renderer, ngStaticData) {
16609
16614
  // -1 for component views
16610
16615
  node: /** @type {?} */ ((null)),
16611
16616
  // until we initialize it in createNode.
16612
- data: /** @type {?} */ ((null)),
16613
- // Hack use as a marker for creationMode
16617
+ data: [],
16614
16618
  ngStaticData: ngStaticData,
16615
16619
  cleanup: null,
16616
16620
  renderer: renderer,
16617
16621
  child: null,
16618
16622
  tail: null,
16619
16623
  next: null,
16620
- bindingStartIndex: null
16624
+ bindingStartIndex: null,
16625
+ creationMode: true,
16626
+ viewHookStartIndex: null
16621
16627
  };
16622
16628
  return newView;
16623
16629
  }
@@ -16685,6 +16691,14 @@ function createLNode(index, type, native, state) {
16685
16691
  isParent = true;
16686
16692
  return node;
16687
16693
  }
16694
+ /**
16695
+ * Resets the application state.
16696
+ * @return {?}
16697
+ */
16698
+ function resetApplicationState() {
16699
+ isParent = false;
16700
+ previousOrParentNode = /** @type {?} */ ((null));
16701
+ }
16688
16702
  /**
16689
16703
  *
16690
16704
  * @template T
@@ -16724,6 +16738,7 @@ function renderComponentOrTemplate(node, viewState, componentOrContext, template
16724
16738
  if (rendererFactory.end) {
16725
16739
  rendererFactory.end();
16726
16740
  }
16741
+ viewState.creationMode = false;
16727
16742
  leaveView(oldView);
16728
16743
  }
16729
16744
  }
@@ -16899,6 +16914,7 @@ function locateHostElement(factory, elementOrSelector) {
16899
16914
  * @return {?}
16900
16915
  */
16901
16916
  function hostElement(rNode, def) {
16917
+ resetApplicationState();
16902
16918
  createLNode(0, 3 /* Element */, rNode, createViewState(-1, renderer, getTemplateStatic(def.template)));
16903
16919
  }
16904
16920
  /**
@@ -17235,12 +17251,41 @@ function generateInitialInputs(directiveIndex, inputs, staticData) {
17235
17251
  return initialInputData;
17236
17252
  }
17237
17253
  /**
17238
- * @param {?} lifeCycle
17254
+ * @param {?} lifecycle
17239
17255
  * @param {?=} self
17240
17256
  * @param {?=} method
17241
17257
  * @return {?}
17242
17258
  */
17243
17259
 
17260
+ /**
17261
+ * Iterates over view hook functions and calls them.
17262
+ * @return {?}
17263
+ */
17264
+ function executeViewHooks() {
17265
+ if (viewHookStartIndex == null)
17266
+ return;
17267
+ // Instead of using splice to remove init hooks after their first run (expensive), we
17268
+ // shift over the AFTER_CHECKED hooks as we call them and truncate once at the end.
17269
+ var /** @type {?} */ checkIndex = /** @type {?} */ (viewHookStartIndex);
17270
+ var /** @type {?} */ writeIndex = checkIndex;
17271
+ while (checkIndex < data.length) {
17272
+ // Call lifecycle hook with its context
17273
+ data[checkIndex + 1].call(data[checkIndex + 2]);
17274
+ if (data[checkIndex] === 16 /* AFTER_VIEW_CHECKED */) {
17275
+ // We know if the writeIndex falls behind that there is an init that needs to
17276
+ // be overwritten.
17277
+ if (writeIndex < checkIndex) {
17278
+ data[writeIndex] = data[checkIndex];
17279
+ data[writeIndex + 1] = data[checkIndex + 1];
17280
+ data[writeIndex + 2] = data[checkIndex + 2];
17281
+ }
17282
+ writeIndex += 3;
17283
+ }
17284
+ checkIndex += 3;
17285
+ }
17286
+ // Truncate once at the writeIndex
17287
+ data.length = writeIndex;
17288
+ }
17244
17289
  /**
17245
17290
  * Creates an LContainer.
17246
17291
  *
@@ -17398,7 +17443,7 @@ function viewEnd() {
17398
17443
  var /** @type {?} */ viewIdChanged = previousView == null ? true : previousView.data.id !== viewNode.data.id;
17399
17444
  if (viewIdChanged) {
17400
17445
  insertView(container, viewNode, containerState.nextIndex - 1);
17401
- creationMode = false;
17446
+ currentView.creationMode = false;
17402
17447
  }
17403
17448
  leaveView(/** @type {?} */ ((/** @type {?} */ ((currentView)).parent)));
17404
17449
  ngDevMode && assertEqual(isParent, false, 'isParent');
@@ -17427,6 +17472,7 @@ var componentRefresh = function (directiveIndex, elementIndex, template) {
17427
17472
  template(directive, creationMode);
17428
17473
  }
17429
17474
  finally {
17475
+ hostView.creationMode = false;
17430
17476
  leaveView(oldView);
17431
17477
  }
17432
17478
  };
@@ -18561,9 +18607,9 @@ function keyframes$1(steps) {
18561
18607
  * <button (click)="next()">Next</button>
18562
18608
  * <hr>
18563
18609
  * <div [\@bannerAnimation]="selectedIndex" class="banner-container">
18564
- * <div class="banner"> {{ banner }} </div>
18610
+ * <div class="banner" *ngFor="let banner of banners"> {{ banner }} </div>
18565
18611
  * </div>
18566
- * `
18612
+ * `,
18567
18613
  * animations: [
18568
18614
  * trigger('bannerAnimation', [
18569
18615
  * transition(":increment", group([
@@ -18583,7 +18629,7 @@ function keyframes$1(steps) {
18583
18629
  * query(':leave', [
18584
18630
  * animate('0.5s ease-out', style({ left: '100%' }))
18585
18631
  * ])
18586
- * ])),
18632
+ * ]))
18587
18633
  * ])
18588
18634
  * ]
18589
18635
  * })
@@ -19175,7 +19221,6 @@ exports.WrappedValue = WrappedValue;
19175
19221
  exports.platformCore = platformCore;
19176
19222
  exports.ɵALLOW_MULTIPLE_PLATFORMS = ALLOW_MULTIPLE_PLATFORMS;
19177
19223
  exports.ɵAPP_ID_RANDOM_PROVIDER = APP_ID_RANDOM_PROVIDER;
19178
- exports.ɵValueUnwrapper = ValueUnwrapper;
19179
19224
  exports.ɵdevModeEqual = devModeEqual;
19180
19225
  exports.ɵisListLikeIterable = isListLikeIterable;
19181
19226
  exports.ɵChangeDetectorStatus = ChangeDetectorStatus;
@@ -19248,35 +19293,36 @@ exports.style = style$$1;
19248
19293
  exports.state = state$$1;
19249
19294
  exports.keyframes = keyframes$$1;
19250
19295
  exports.transition = transition$$1;
19251
- exports.ɵbe = animate$1;
19252
- exports.ɵbf = group$1;
19253
- exports.ɵbj = keyframes$1;
19254
- exports.ɵbg = sequence$1;
19255
- exports.ɵbi = state$1;
19256
- exports.ɵbh = style$1;
19257
- exports.ɵbk = transition$1;
19258
- exports.ɵbd = trigger$1;
19259
- exports.ɵm = _iterableDiffersFactory;
19260
- exports.ɵn = _keyValueDiffersFactory;
19261
- exports.ɵo = _localeFactory;
19262
- exports.ɵh = _appIdRandomProviderFactory;
19263
- exports.ɵi = defaultIterableDiffers;
19264
- exports.ɵj = defaultKeyValueDiffers;
19265
- exports.ɵk = DefaultIterableDifferFactory;
19266
- exports.ɵl = DefaultKeyValueDifferFactory;
19267
- exports.ɵd = ReflectiveInjector_;
19268
- exports.ɵf = ReflectiveDependency;
19269
- exports.ɵg = resolveReflectiveProviders;
19270
- exports.ɵq = wtfEnabled;
19271
- exports.ɵu = createScope;
19272
- exports.ɵr = detectWTF;
19273
- exports.ɵy = endTimeRange;
19274
- exports.ɵw = leave;
19275
- exports.ɵx = startTimeRange;
19276
- exports.ɵbb = stringify$1;
19296
+ exports.ɵbf = animate$1;
19297
+ exports.ɵbg = group$1;
19298
+ exports.ɵbk = keyframes$1;
19299
+ exports.ɵbh = sequence$1;
19300
+ exports.ɵbj = state$1;
19301
+ exports.ɵbi = style$1;
19302
+ exports.ɵbl = transition$1;
19303
+ exports.ɵbe = trigger$1;
19304
+ exports.ɵn = _iterableDiffersFactory;
19305
+ exports.ɵo = _keyValueDiffersFactory;
19306
+ exports.ɵq = _localeFactory;
19307
+ exports.ɵi = _appIdRandomProviderFactory;
19308
+ exports.ɵj = defaultIterableDiffers;
19309
+ exports.ɵk = defaultKeyValueDiffers;
19310
+ exports.ɵl = DefaultIterableDifferFactory;
19311
+ exports.ɵm = DefaultKeyValueDifferFactory;
19312
+ exports.ɵf = ReflectiveInjector_;
19313
+ exports.ɵg = ReflectiveDependency;
19314
+ exports.ɵh = resolveReflectiveProviders;
19315
+ exports.ɵr = wtfEnabled;
19316
+ exports.ɵw = createScope;
19317
+ exports.ɵu = detectWTF;
19318
+ exports.ɵz = endTimeRange;
19319
+ exports.ɵx = leave;
19320
+ exports.ɵy = startTimeRange;
19321
+ exports.ɵbc = stringify$1;
19277
19322
  exports.ɵa = makeParamDecorator;
19278
- exports.ɵz = _def;
19279
- exports.ɵba = DebugContext;
19323
+ exports.ɵd = makePropDecorator;
19324
+ exports.ɵba = _def;
19325
+ exports.ɵbb = DebugContext;
19280
19326
 
19281
19327
  Object.defineProperty(exports, '__esModule', { value: true });
19282
19328