import { ApplicationRef, Component, Inject } from '@angular/core'; import { GenericComponent } from '@leanup/lib'; import IMG_FRAMEWORK from '../../assets/logo.angular.png'; import { RouterService } from '../../services/router/service'; import { AppController, ResolvedRoute } from './controller'; @Component({ selector: 'app', template: `
Angular Framework
+
Leanup Stack

{{ ctrl.framework.name }} v{{ ctrl.framework.version }}

{{ ctrl.finishedRendering }} ms upcomming time Used filters: {{ ctrl.filters.date(ctrl.dummies.date) }} | {{ ctrl.filters.currency(ctrl.dummies.price) }} €
Build with: {{ ctrl.cli.name }} v{{ ctrl.cli.version }}
`, }) export class AppComponent implements GenericComponent { public ctrl: AppController; public readonly frameworkImg: string = IMG_FRAMEWORK as string; public resolvedRoute: ResolvedRoute = { url: 'series', }; public constructor(@Inject(ApplicationRef) appRef: ApplicationRef) { this.ctrl = new AppController({ hooks: { doRender: appRef.tick.bind(this), }, }); RouterService.subscribe( ( route: { url: string; }, data: { id: string; } ) => { this.resolvedRoute = { data, url: route.url, }; appRef.tick(); } ); } }