X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Fapp%2Fwim-accounts%2Fnew-wim-account%2FNewWIMAccountComponent.ts;h=65ae9370b58cf6ea0c71bbed921d0c60a53ab32a;hb=refs%2Fheads%2Fmaster;hp=7587b584a495124a828808de7535e4abae42ab1c;hpb=3b4814aa2d3dec621dadb52f058ba95a3dc3a86a;p=osm%2FNG-UI.git diff --git a/src/app/wim-accounts/new-wim-account/NewWIMAccountComponent.ts b/src/app/wim-accounts/new-wim-account/NewWIMAccountComponent.ts index 7587b58..2fa3b96 100644 --- a/src/app/wim-accounts/new-wim-account/NewWIMAccountComponent.ts +++ b/src/app/wim-accounts/new-wim-account/NewWIMAccountComponent.ts @@ -28,8 +28,7 @@ import { APIURLHEADER, ERRORDATA, MODALCLOSERESPONSEDATA, TYPESECTION, WIM_TYPES import { environment } from 'environment'; import * as jsyaml from 'js-yaml'; import { RestService } from 'RestService'; -import { SharedService } from 'SharedService'; -import { isNullOrUndefined } from 'util'; +import { SharedService, isNullOrUndefined } from 'SharedService'; /** * Creating component @@ -71,6 +70,9 @@ export class NewWIMAccountComponent implements OnInit { /** 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; @@ -86,8 +88,8 @@ export class NewWIMAccountComponent implements OnInit { /** 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; @@ -110,9 +112,6 @@ export class NewWIMAccountComponent implements OnInit { }); } - /** convenience getter for easy access to form fields */ - get f(): FormGroup['controls'] { return this.wimNewAccountForm.controls; } - /** * Lifecyle Hooks the trigger before component is instantiate */ @@ -169,7 +168,6 @@ export class NewWIMAccountComponent implements OnInit { 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') {