@micropermit/client-angular 0.2.9-beta.1 → 0.2.9-beta.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.
@@ -825,13 +825,17 @@
825
825
  if (interval) {
826
826
  this.stopRefresh();
827
827
  }
828
- this.initWithObs();
828
+ if (!this.isInitialized()) {
829
+ this.initWithObs();
830
+ }
829
831
  if (interval) {
830
832
  this.intervalId = setInterval((/**
831
833
  * @return {?}
832
834
  */
833
835
  function () {
834
- _this.initWithObs().subscribe();
836
+ if (!_this.isInitialized()) {
837
+ _this.initWithObs().subscribe();
838
+ }
835
839
  }), interval);
836
840
  }
837
841
  };
@@ -2061,7 +2065,6 @@
2061
2065
  this.hasResult = false;
2062
2066
  this.subscription = null;
2063
2067
  this.linkFieldDefaultErrorHandling = false;
2064
- this.linkLoaded = new core.EventEmitter();
2065
2068
  this._defaultLoadingComponent = componentResolver.resolveComponentFactory(MicroClientLoadingIndicatorComponent);
2066
2069
  this._defaultErrorComponent = componentResolver.resolveComponentFactory(MicroClientErrorIndicatorComponent);
2067
2070
  }
@@ -2132,7 +2135,7 @@
2132
2135
  if (this._from) {
2133
2136
  if (this._from instanceof LinkField) {
2134
2137
  this.setLoading(true);
2135
- this.lastObs = this._from.getObs();
2138
+ this.lastObs = this._from.listenObs();
2136
2139
  this.subscription = this.lastObs.pipe(operators.finalize((/**
2137
2140
  * @return {?}
2138
2141
  */
@@ -2144,7 +2147,9 @@
2144
2147
  */
2145
2148
  function (loadedResult) {
2146
2149
  _this.setLoadedResult(loadedResult);
2147
- _this.linkLoaded.emit(loadedResult);
2150
+ if (_this.linkFieldValueChange) {
2151
+ _this.linkFieldValueChange(loadedResult);
2152
+ }
2148
2153
  }), (/**
2149
2154
  * @param {?} loadError
2150
2155
  * @return {?}
@@ -2245,15 +2250,22 @@
2245
2250
  function (result) {
2246
2251
  this.hasResult = true;
2247
2252
  this.loadedResult = result;
2248
- if (this._viewContainer && this._template) {
2249
- /** @type {?} */
2250
- var currentContext = new LinkFieldContext(result);
2251
- this._viewContainer.remove();
2252
- this._viewContainer.createEmbeddedView(this._template, currentContext);
2253
+ if (this.currentContext == null) {
2254
+ this.currentContext = new LinkFieldContext(result);
2255
+ this.isDirty = true;
2253
2256
  }
2254
2257
  else {
2258
+ this.currentContext.$implicit = result;
2259
+ }
2260
+ if (!this._viewContainer || !this._template) {
2255
2261
  this.isDirty = true;
2256
2262
  }
2263
+ else {
2264
+ if (this.isDirty) {
2265
+ this._viewContainer.remove();
2266
+ this._viewContainer.createEmbeddedView(this._template, this.currentContext);
2267
+ }
2268
+ }
2257
2269
  };
2258
2270
  /**
2259
2271
  * @private
@@ -2310,7 +2322,7 @@
2310
2322
  linkFieldErrorTemplate: [{ type: core.Input }],
2311
2323
  linkFieldTemplate: [{ type: core.Input }],
2312
2324
  linkFieldDefaultErrorHandling: [{ type: core.Input }],
2313
- linkLoaded: [{ type: core.Output }]
2325
+ linkFieldValueChange: [{ type: core.Input }]
2314
2326
  };
2315
2327
  return LinkFieldDirective;
2316
2328
  }());
@@ -2370,10 +2382,15 @@
2370
2382
  * @private
2371
2383
  */
2372
2384
  LinkFieldDirective.prototype.subscription;
2385
+ /**
2386
+ * @type {?}
2387
+ * @private
2388
+ */
2389
+ LinkFieldDirective.prototype.currentContext;
2373
2390
  /** @type {?} */
2374
2391
  LinkFieldDirective.prototype.linkFieldDefaultErrorHandling;
2375
2392
  /** @type {?} */
2376
- LinkFieldDirective.prototype.linkLoaded;
2393
+ LinkFieldDirective.prototype.linkFieldValueChange;
2377
2394
  /**
2378
2395
  * @type {?}
2379
2396
  * @private