Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ngAfterViewInit() {
const foundation = this._foundation = new MDCSwitchFoundation(this._adapter);
foundation.setDisabled(this.disabled);
foundation.setChecked(this.checked);
}
mounted() {
this.foundation = new MDCSwitchFoundation({
addClass: className => this.$set(this.classes, className, true),
removeClass: className => this.$delete(this.classes, className),
setNativeControlChecked: checked => (this.nativeControlChecked = checked),
setNativeControlDisabled: disabled =>
(this.nativeControlDisabled = disabled),
});
this.foundation.init();
this.foundation.setChecked(this.checked);
this.foundation.setDisabled(this.disabled);
this.ripple = new RippleBase(this);
this.ripple.init();
},
beforeDestroy() {
mounted() {
this.foundation = new MDCSwitchFoundation({
addClass: className => this.$set(this.classes, className, true),
removeClass: className => this.$delete(this.classes, className),
setNativeControlChecked: checked => (this.nativeControlChecked = checked),
setNativeControlDisabled: disabled =>
(this.nativeControlDisabled = disabled),
});
this.foundation.init();
this.foundation.setChecked(this.checked);
this.foundation.setDisabled(this.disabled);
this.ripple = new RippleBase(this);
this.ripple.init();
},
beforeDestroy() {
componentDidMount() {
this.foundation = new MDCSwitchFoundation(this.adapter);
this.foundation.init();
this.foundation.setChecked(this.props.checked!);
this.foundation.setDisabled(this.props.disabled!);
}
attached() {
this.myMDCSwitch = new MDCSwitch(this.element.firstElementChild);
}
bind() {
this.myMDCSwitch = new MDCSwitch(this.element.firstElementChild);
}
MdcSwitch.prototype.bind = function bind() {
this.myMDCSwitch = new _mdcSwitch.MDCSwitch(this.element.firstElementChild);
};
_proto.attached = function attached() {
this.myMDCSwitch = new _mdcSwitch.MDCSwitch(this.element.firstElementChild);
};
public componentDidMount() {
super.componentDidMount();
if (this.control) {
this.MDComponent = new MDCSwitch(this.control);
}
}
installed() {
this.switchControl = new MDCSwitch(this.shadowRoot.querySelector('.mdc-switch'))
this.switchFoundation = this.switchControl.getDefaultFoundation()
this.initSwitch()
}