@rxap/forms 13.0.4 → 13.0.5

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.
@@ -1242,10 +1242,14 @@ class FormDirective extends FormGroupDirective {
1242
1242
  }
1243
1243
  }
1244
1244
  ngOnInit() {
1245
- if (!this.form) {
1245
+ if (!this._formDefinition) {
1246
1246
  // TODO : replace with rxap error
1247
1247
  throw new Error('The form definition instance is not defined');
1248
1248
  }
1249
+ if (!this.form) {
1250
+ // TODO : replace with rxap error
1251
+ throw new Error('The form instance is not defined');
1252
+ }
1249
1253
  this.loadInitialState(this.form);
1250
1254
  function HasNgOnInitMethod(obj) {
1251
1255
  return obj && typeof obj.ngOnInit === 'function';
@@ -1257,8 +1261,14 @@ class FormDirective extends FormGroupDirective {
1257
1261
  const debounce = typeof this._formDefinition.rxapMetadata.autoSubmit === 'number'
1258
1262
  ? this._formDefinition.rxapMetadata.autoSubmit
1259
1263
  : 5000;
1260
- this._autoSubmitSubscription = this.form.valueChanges
1261
- .pipe(debounceTime(debounce), filter(() => this.form.valid), tap((value) => console.debug(`Auto submit form '${this._formDefinition.rxapMetadata.id}'`, value)), tap(() => this.submit()))
1264
+ this._autoSubmitSubscription = this
1265
+ .form
1266
+ .valueChanges
1267
+ .pipe(debounceTime(debounce), filter(() => this.form.valid), tap((value) => {
1268
+ if (isDevMode()) {
1269
+ console.debug(`Auto submit form '${this._formDefinition.rxapMetadata.id}'`, value);
1270
+ }
1271
+ }), tap(() => this.submit()))
1262
1272
  .subscribe();
1263
1273
  }
1264
1274
  }