Ben Cull - Payments Engineer and Microsoft Development Professional

Angular Directive for Bootstrap-Switch

Have you seen the Bootstrap Switch? If not, check it out:


Angular Directive

Once you’ve added bootstrap-switch to your project, simply add this directive to your app.js or controller.


<input type="checkbox" ng-model="mymodel.mystate" bootstrap-switch />

WARNING I can’t stress this enough:

“Always use a dot in your ng-model”

  • A war-torn, battle-scarred, mentally-exhausted person who didn’t do exactly this

Scoping and binding are potentially screwed if you don’t. It is a difficult problem to find and understand.

Further reading is required:

Angular Directive for Bootstrap-Switch
Prev post

IE is caching my AngularJS requests to ASP.NET MVC

Next post

Handling Validation Errors with AngularJS and ASP.NET MVC

Angular Directive for Bootstrap-Switch

Get in touch

Send me a message and I'll get back to you.