export function ProgressPointGroupDirectiveFactory() { return new ProgressPointGroupDirective(); } class ProgressPointGroupDirective implements angular.IDirective { restrict = 'E'; template = require('./ProgressPointGroup.html'); controllerAs = 'ctrl'; controller = ProgressPointGroupController; scope = { numberOfPoints: '=', progressPointSelected: "=" }; bindToController = true; } export class ProgressPointGroupController { public numberOfPoints: number; public progressPointSelected: IProgressPointPosition; range(): number[] { return new Array(this.numberOfPoints); } changeProgress(progressIndex: number) { if (this.numberOfPoints) { this.progressPointSelected.index = progressIndex; } } } export interface IProgressPointPosition { index: number; }