UNPKG

@aurelia-mdc-web/switch

Version:

Wrapper for Material Components Web Switch

23 lines 897 B
import { PLATFORM, bindingMode, EventSubscriber, ValueAttributeObserver } from 'aurelia-framework'; import { MdcComponentAdapters } from '@aurelia-mdc-web/base'; export { MdcSwitch } from './mdc-switch'; export function configure(config) { config.container.get(MdcComponentAdapters).registerMdcElementConfig(switchConfig); config.globalResources([ PLATFORM.moduleName('./mdc-switch'), PLATFORM.moduleName('./enhance-mdc-switch') ]); config.aurelia.use.plugin(PLATFORM.moduleName('@aurelia-mdc-web/ripple')); } var switchConfig = { tagName: 'mdc-switch', properties: { selected: { defaultBindingMode: bindingMode.twoWay, getObserver: function (element) { return new ValueAttributeObserver(element, 'selected', new EventSubscriber(['change'])); } } } }; //# sourceMappingURL=index.js.map