k15t-aui-ng2
Version:
aui-ng2 is a set of angular 2 components, directives and services to simplify the integration with Atlassian products based on AUI/ADG. The library is still under development and is considered in an experimental state. So be aware that things will change
55 lines (48 loc) • 1.61 kB
text/typescript
import {Component, Input, Output, EventEmitter} from '@angular/core';
import {FORM_DIRECTIVES} from '@angular/common';
export class AuiNgRadioButtonGroupComponent {
orientation: string;
title: string;
name: string;
selection: any;
items: any[];
idProperty: string;
labelProperty: any;
changed : EventEmitter<any> = new EventEmitter<any>();
private selection: any = {};
private onChange (item) {
this.changed.emit(item);
}
private getLabel(item: any): string {
if (typeof this.labelProperty === 'function') {
return this.labelProperty(item);
}
return item && item[this.labelProperty];
}
private getId(item:any):string {
return item && item[this.idProperty];
}
}