@micropermit/client-angular 0.2.9-beta.9 → 0.2.11

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,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('rxjs'), require('rxjs/operators'), require('@angular/common'), require('@angular/forms')) :
3
- typeof define === 'function' && define.amd ? define('@micropermit/client-angular', ['exports', '@angular/core', '@angular/common/http', 'rxjs', 'rxjs/operators', '@angular/common', '@angular/forms'], factory) :
4
- (global = global || self, factory((global.micropermit = global.micropermit || {}, global.micropermit['client-angular'] = {}), global.ng.core, global.ng.common.http, global.rxjs, global.rxjs.operators, global.ng.common, global.ng.forms));
5
- }(this, (function (exports, core, http, rxjs, operators, common, forms) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('rxjs'), require('rxjs/operators'), require('lodash'), require('@angular/common'), require('@angular/forms')) :
3
+ typeof define === 'function' && define.amd ? define('@micropermit/client-angular', ['exports', '@angular/core', '@angular/common/http', 'rxjs', 'rxjs/operators', 'lodash', '@angular/common', '@angular/forms'], factory) :
4
+ (global = global || self, factory((global.micropermit = global.micropermit || {}, global.micropermit['client-angular'] = {}), global.ng.core, global.ng.common.http, global.rxjs, global.rxjs.operators, global.lodash, global.ng.common, global.ng.forms));
5
+ }(this, (function (exports, core, http, rxjs, operators, lodash, common, forms) { 'use strict';
6
6
 
7
7
  /*! *****************************************************************************
8
8
  Copyright (c) Microsoft Corporation. All rights reserved.
@@ -815,13 +815,15 @@
815
815
  };
816
816
  /**
817
817
  * @param {?=} interval
818
+ * @param {?=} errorHandler
818
819
  * @return {?}
819
820
  */
820
821
  LinkField.prototype.refresh = /**
821
822
  * @param {?=} interval
823
+ * @param {?=} errorHandler
822
824
  * @return {?}
823
825
  */
824
- function (interval) {
826
+ function (interval, errorHandler) {
825
827
  var _this = this;
826
828
  if (interval) {
827
829
  this.stopRefresh();
@@ -834,7 +836,16 @@
834
836
  _this.isRefreshing = false;
835
837
  });
836
838
  this.isRefreshing = true;
837
- this.initWithObs().subscribe(resCb, resCb, resCb);
839
+ this.initWithObs().subscribe(resCb, (/**
840
+ * @param {?} error
841
+ * @return {?}
842
+ */
843
+ function (error) {
844
+ resCb();
845
+ if (errorHandler) {
846
+ errorHandler(error);
847
+ }
848
+ }), resCb);
838
849
  if (interval) {
839
850
  this.intervalId = setInterval((/**
840
851
  * @return {?}
@@ -842,7 +853,16 @@
842
853
  function () {
843
854
  if (!_this.isRefreshing) {
844
855
  _this.isRefreshing = true;
845
- _this.initWithObs().subscribe(resCb, resCb, resCb);
856
+ _this.initWithObs().subscribe(resCb, (/**
857
+ * @param {?} error
858
+ * @return {?}
859
+ */
860
+ function (error) {
861
+ resCb();
862
+ if (errorHandler) {
863
+ errorHandler(error);
864
+ }
865
+ }), resCb);
846
866
  }
847
867
  }), interval);
848
868
  }
@@ -1075,17 +1095,17 @@
1075
1095
  /**
1076
1096
  * @template T
1077
1097
  * @param {?} toCopy
1078
- * @param {?} client
1098
+ * @param {?=} client
1079
1099
  * @return {?}
1080
1100
  */
1081
1101
  MicroObject.deepCopy = /**
1082
1102
  * @template T
1083
1103
  * @param {?} toCopy
1084
- * @param {?} client
1104
+ * @param {?=} client
1085
1105
  * @return {?}
1086
1106
  */
1087
1107
  function (toCopy, client) {
1088
- return (/** @type {?} */ (MicroObject.fromString(JSON.stringify(toCopy), client)));
1108
+ return (/** @type {?} */ (lodash.cloneDeep(toCopy)));
1089
1109
  };
1090
1110
  /**
1091
1111
  * @template T
@@ -1552,13 +1572,8 @@
1552
1572
  function (val) {
1553
1573
  /** @type {?} */
1554
1574
  var entryPoint = MicroObject.fromObject(val, _this);
1555
- if (entryPoint instanceof MicroObject) {
1556
- _this.setEntryPoint(entryPoint);
1557
- return (/** @type {?} */ (entryPoint));
1558
- }
1559
- else {
1560
- throw Error('Expected the entryPoint to be a Object');
1561
- }
1575
+ _this.setEntryPoint(entryPoint);
1576
+ return (/** @type {?} */ (entryPoint));
1562
1577
  })), this.catchAndHandleError());
1563
1578
  };
1564
1579
  /**