/**
* @file WIM Account Component.
*/
+import { isNullOrUndefined } from 'util';
import { HttpHeaders } from '@angular/common/http';
import { Component, ElementRef, Injector, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import * as jsyaml from 'js-yaml';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
/** Element ref for fileInputConfig @public */
@ViewChild('fileInputConfigLabel', { static: true }) public fileInputConfigLabel: ElementRef;
+ /** Contains all methods related to shared @private */
+ public sharedService: SharedService;
+
/** Instance of the rest service @private */
private restService: RestService;
/** Contains tranlsate instance @private */
private translateService: TranslateService;
- /** Contains all methods related to shared @private */
- private sharedService: SharedService;
+ /** convenience getter for easy access to form fields */
+ get f(): FormGroup['controls'] { return this.wimNewAccountForm.controls; }
constructor(injector: Injector) {
this.injector = injector;
});
}
- /** convenience getter for easy access to form fields */
- get f(): FormGroup['controls'] { return this.wimNewAccountForm.controls; }
-
/**
* Lifecyle Hooks the trigger before component is instantiate
*/
if (files && files.length === 1) {
this.sharedService.getFileString(files, 'yaml').then((fileContent: string): void => {
const getConfigJson: string = jsyaml.load(fileContent, { json: true });
- // tslint:disable-next-line: no-backbone-get-set-outside-model
this.wimNewAccountForm.get('config').setValue(JSON.stringify(getConfigJson));
}).catch((err: string): void => {
if (err === 'typeError') {