Created
November 25, 2016 09:51
-
-
Save narenaryan/1705de848e9baffa5e5bf2c840905841 to your computer and use it in GitHub Desktop.
Angular JS implementation of Bootstrap Select
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var app = angular.module('sampleApp'); | |
| // add this directive to your app | |
| app.directive( 'bootstrapSelect', [function() { | |
| return { | |
| restrict: 'A', | |
| link: function( scope, elem, attrs ) { | |
| elem.ready(function(){ | |
| elem.selectpicker(); | |
| }); | |
| } | |
| } | |
| }]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- In HTML add bootstrap-select directive to select element --> | |
| <select class="form-control" bootstrap-select> | |
| <option value="A">A</option> | |
| <option value="B">B</option> | |
| <option value="C">C</option> | |
| </select> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment