Skip to content

Instantly share code, notes, and snippets.

@alissonbovenzo
Created June 17, 2015 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alissonbovenzo/e05f3f8d70d0054df686 to your computer and use it in GitHub Desktop.
Save alissonbovenzo/e05f3f8d70d0054df686 to your computer and use it in GitHub Desktop.
Directive for select type input 4 materialize.css
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