layout-widjet.component.ts 954 Bytes
Newer Older
Ooh-Ao committed
1 2
import { Component, OnInit } from '@angular/core';
import { ServicesComponent } from '../services/services.component';
Ooh-Ao committed
3
import { Service, WidjetService } from '../services/widjet.service';
Ooh-Ao committed
4
import { CommonModule } from '@angular/common';
Ooh-Ao committed
5
import { ActivatedRoute } from '@angular/router';
Ooh-Ao committed
6 7 8 9 10 11 12 13 14

@Component({
  selector: 'app-layout-widjet',
  standalone: true,
  imports: [CommonModule, ServicesComponent],
  templateUrl: './layout-widjet.component.html',
  styleUrls: ['./layout-widjet.component.css']
})
export class LayoutWidjetComponent implements OnInit {
Ooh-Ao committed
15
  appName = ""
Ooh-Ao committed
16 17
  widjetId = 0
  widgetList: Service[] = []
Ooh-Ao committed
18 19 20 21 22 23
  constructor(private widjetService: WidjetService, private readonly activatedRoute: ActivatedRoute) {
    this.activatedRoute.paramMap.subscribe(result => {
      this.appName = result.get('appName')!
      this.widgetList = this.widjetService.widjetConfig.filter(e => e.appName == this.appName)[0].widjet
    })

Ooh-Ao committed
24 25 26 27 28 29
  }

  ngOnInit() {
  }

}