Created
June 17, 2015 04:26
-
-
Save alissonbovenzo/e05f3f8d70d0054df686 to your computer and use it in GitHub Desktop.
Directive for select type input 4 materialize.css
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
angular.module('standard.directives',[]) | |
.directive('selectExemplo',function($timeout){ | |
return{ | |
scope:{ | |
fields : '=', | |
nameMasterField: '@' | |
}, | |
template : '<div class="input-field s12 m8 col">' + | |
'<select id="selectExemplo" data-ng-model="selected" data-ng-options="campo.id as campo.name for campo in fields"></select>' + | |
'<label>{{nameMasterField}}</label>'+ | |
'</div>', | |
link: function($scope, elem, attrs, ngModel){ | |
$timeout(function(){ | |
elem.find('select').material_select(); | |
}); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment