feat(radio): add radio and radio group component

This commit is contained in:
Brandy Carney
2017-09-01 18:47:56 -04:00
parent 374bdd3668
commit f1ac5304d6
10 changed files with 1083 additions and 0 deletions

View File

@ -18,6 +18,25 @@ export function isFunction(v: any): v is (Function) { return typeof v === 'funct
export function isStringOrNumber(v: any): v is (string | number) { return isString(v) || isNumber(v); }
/** @hidden */
export function isCheckedProperty(a: any, b: any): boolean {
if (a === undefined || a === null || a === '') {
return (b === undefined || b === null || b === '');
} else if (a === true || a === 'true') {
return (b === true || b === 'true');
} else if (a === false || a === 'false') {
return (b === false || b === 'false');
} else if (a === 0 || a === '0') {
return (b === 0 || b === '0');
}
// not using strict comparison on purpose
return (a == b); // tslint:disable-line
};
export function assert(bool: boolean, msg: string) {
if (!bool) {
console.error(msg);