converter/app/app.component.ts

27 lines
877 B
TypeScript
Raw Normal View History

2016-09-15 12:40:13 +02:00
import {Component} from "@angular/core";
import {OnInit}from "@angular/core";
import {ConverterregistryService} from "./converterregistry.service";
import {Converter} from "./converter";
2016-08-15 17:12:11 +02:00
@Component({
moduleId: module.id,
2016-08-15 17:12:11 +02:00
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());
}
}
}