UNPKG

1.55 kBSource Map (JSON)View Raw
1{"version":3,"sources":["core/annotations/field-value.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH;IACE,MAAM,CAAC,mCAAmC,MAAW,EAAE,GAAW;QAChE,IAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QACjC,IAAM,QAAQ,GAAG,yBAAuB,GAAK,CAAC;QAC9C,MAAM,CAAC,QAAQ,CAAC,GAAG,YAAY,CAAC;QAEhC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE;YACjC,GAAG,gBAAK,MAAM,CAAO,IAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YACvC,GAAG,YAAC,KAAc;gBACV,IAAK,CAAC,QAAQ,CAAC,GAAG,KAAK,IAAI,IAAI,IAAI,KAAG,KAAO,KAAK,OAAO,CAAC;YAClE,CAAC;SACF,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAGD,SAAS,wBAAwB,IAAI,iBAAiB,GAAG","file":"core/annotations/field-value.js","sourcesContent":["/**\n * Annotation Factory that allows HTML style boolean attributes. For example,\n * a field declared like this:\n\n * @Directive({ selector: 'component' }) class MyComponent {\n * @Input() @BooleanFieldValueFactory() myField: boolean;\n * }\n *\n * You could set it up this way:\n * <component myField>\n * or:\n * <component myField=\"\">\n * @deprecated\n */\nfunction booleanFieldValueFactory() {\n return function booleanFieldValueMetadata(target: any, key: string): void {\n const defaultValue = target[key];\n const localKey = `__md_private_symbol_${key}`;\n target[localKey] = defaultValue;\n\n Object.defineProperty(target, key, {\n get() { return (<any>this)[localKey]; },\n set(value: boolean) {\n (<any>this)[localKey] = value != null && `${value}` !== 'false';\n }\n });\n };\n}\n\n\nexport { booleanFieldValueFactory as BooleanFieldValue };\n"],"sourceRoot":"/source/"}
\No newline at end of file