Instantly share code, notes, and snippets.

Embed
What would you like to do?
Slidertoggle
<md-slide-toggle>SlideToggle!</md-slide-toggle>
<br><br>
<md-slide-toggle labelPosition="before">label-before</md-slide-toggle>
<md-slide-toggle labelPosition="after">label-after</md-slide-toggle>
<br><br>
<md-slide-toggle disableRipple="true">disableRipple!!</md-slide-toggle>
<br><br>
<md-slide-toggle checked="true">checked!!</md-slide-toggle>
<br><br>
<md-slide-toggle
[labelPosition]="toggle.position"
[disableRipple]="toggle.disableRipple"
[checked]="toggle.checked"
(change)="toggle.change()"
>
{{toggle.name}}
</md-slide-toggle>
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-slidetoggle',
templateUrl: './slidetoggle.component.html',
styleUrls: ['./slidetoggle.component.css']
})
export class SlidetoggleComponent implements OnInit {
toggle = {
'name' : 'トグル',
'position' : 'before',
'checked' : false,
'disableRipple' : 'true',
'change' : () => {
console.log('ChangeEvent');
}
}
constructor() { }
ngOnInit() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment