]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | import { Component, Input, OnChanges } from '@angular/core'; |
2 | ||
3 | import { MgrModuleService } from '../../../../shared/api/mgr-module.service'; | |
4 | import { CdTableSelection } from '../../../../shared/models/cd-table-selection'; | |
5 | ||
6 | @Component({ | |
7 | selector: 'cd-mgr-module-details', | |
8 | templateUrl: './mgr-module-details.component.html', | |
9 | styleUrls: ['./mgr-module-details.component.scss'] | |
10 | }) | |
11 | export class MgrModuleDetailsComponent implements OnChanges { | |
12 | module_config: any; | |
13 | ||
14 | @Input() | |
15 | selection: CdTableSelection; | |
16 | ||
17 | constructor(private mgrModuleService: MgrModuleService) {} | |
18 | ||
19 | ngOnChanges() { | |
20 | if (this.selection.hasSelection) { | |
21 | const selectedItem = this.selection.first(); | |
22 | this.mgrModuleService.getConfig(selectedItem.name).subscribe((resp: any) => { | |
23 | this.module_config = resp; | |
24 | }); | |
25 | } | |
26 | } | |
27 | } |