MCPcopy Create free account
hub / github.com/OpenCBS/OpenCBS-Cloud / ngOnInit

Method ngOnInit

client/src/app/app.component.ts:32–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30 }
31
32 ngOnInit() {
33 this.store$.dispatch(new fromStore.CheckAuth());
34
35 this.systemSettingSub = this.store$.pipe(select(fromRoot.getSystemSettingState))
36 .subscribe((response: any) => {
37 if ( response.systemSetting.length ) {
38 const fieldsArray = [];
39 const fieldData = response.systemSetting;
40 fieldData.map(item => {
41 const tempObj = {};
42 if ( item['value'] ) {
43 tempObj['value'] = item['value'];
44 }
45
46 let fieldMeta;
47 if ( item['customField'] ) {
48 fieldMeta = item['customField'];
49 } else {
50 fieldMeta = item;
51 }
52
53 for (const key in fieldMeta) {
54 if ( fieldMeta.hasOwnProperty(key) ) {
55 tempObj[key] = fieldMeta[key];
56 }
57 }
58
59 fieldsArray.push(tempObj);
60 });
61 this.systemSettingsShareService.setData(fieldsArray);
62 }
63 });
64 }
65
66 ngAfterContentChecked() {
67 this.appReadyService.trigger();

Callers

nothing calls this directly

Calls 2

mapMethod · 0.45
setDataMethod · 0.45

Tested by

no test coverage detected