26 lines
877 B
TypeScript
26 lines
877 B
TypeScript
import {Component} from "@angular/core";
|
|
import {OnInit}from "@angular/core";
|
|
|
|
import {ConverterregistryService} from "./converterregistry.service";
|
|
import {Converter} from "./converter";
|
|
|
|
@Component({
|
|
moduleId: module.id,
|
|
selector: "den-app",
|
|
templateUrl: "app.component.html",
|
|
styleUrls: ["app.component.css"],
|
|
providers: [ConverterregistryService]
|
|
})
|
|
export class AppComponent extends OnInit {
|
|
constructor(private converterregistryService:ConverterregistryService) {
|
|
super();
|
|
}
|
|
|
|
ngOnInit():void {
|
|
let converters:Converter[] = this.converterregistryService.getConverters();
|
|
console.log("Number of registered converters: " + converters.length);
|
|
for (let i = 0; i < converters.length; i++) {
|
|
console.log("Converter " + converters[i].getId() + ": " + converters[i].getDisplayname());
|
|
}
|
|
}
|
|
}
|