Toggle a boolean value using a fancy slider
<slide-toggle ng-model="slideToggleOnOff"><slide-toggle>
You can use the on-label
and offLabel
attributes to modify the text displayed for each option
<slide-toggle on-label="Active" offLabel="Inactive" ng-model="slideToggleActiveInactve"><slide-toggle>
You can use the on
and off
attributes to execute scope methods when the slider enters that state. This is useful for times where you need more functionality than simply toggling a value.
<slide-toggle on="Active" off="Inactive" ng-model="slideToggleActiveInactve" disable-triggers-on-init><slide-toggle>
Note: The use of disable-triggers-on-init
here prevents the triggers from being executed when the page loads.