import { ItbeesArtboardLibComponent, PassComponentService } from 'itbees-artboard-lib'; import { Component, inject, OnInit,} from '@angular/core'; import { SomeComponent } from '../some/some.component'; import { TestComponent } from './test/test.component'; import { RouterOutlet } from '@angular/router'; import { DropdownModule } from 'primeng/dropdown'; import { FormsModule } from '@angular/forms'; import { ArtboardsService } from './services/artboards.service'; import { IArtboardVm } from './services/artboard-vm.model'; @Component({ selector: 'app-root', standalone: true, imports: [RouterOutlet, ItbeesArtboardLibComponent, DropdownModule, FormsModule], templateUrl: './app.component.html', styleUrl: './app.component.scss' }) export class AppComponent implements OnInit{ title = 'itbees_artboard'; passComponentService = inject(PassComponentService); artboardsService = inject(ArtboardsService) selectedArtboard!:IArtboardVm artboards: IArtboardVm[] = []; ngOnInit(): void { this.passComponentService.registerComponent('Kamera', SomeComponent); this.passComponentService.registerComponent('Szlaban', TestComponent); this.getArtboards() } getArtboards(): void { this.artboardsService.get().subscribe({ next: (res) => { this.artboards = res.data; if(res.data){ this.selectedArtboard=res.data[0] } }, error: (err) => console.error('Błąd podczas pobierania artboardów:', err), }); } }