X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=app%2Fjs%2Fdirectives.js;h=ac273fe5909f09ae46ba46a316b2cc163f099fda;hb=3b3aab3a072bc2ad0dc4bc18f951948d02045cde;hp=fb7b81e3f4df15a2642ca0e7821cec960e0ab7bd;hpb=5273e22cbd006b0b6658e69b4984b619c6657926;p=angular-drzb diff --git a/app/js/directives.js b/app/js/directives.js index fb7b81e..ac273fe 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -14,13 +14,115 @@ angular.module('myApp.directives', []). restrict: 'C', compile: function(element, attrs) { var my_class = attrs['class'] || ''; + my_class = my_class.replace(/ *my-input */,''); var my_type = attrs['type'] || 'text'; - var html = '
' + var html = '
' +'' - +'' - +'
' + +''+ +' '+ +'
'+ +' '+ +'
'; + + element.replaceWith(html); + } + }; +}) + +.directive('myLabelSelect', function() { + return { + restrict: 'C', + compile: function(element, attrs) { + var my_class = attrs['class'] || ''; + my_class = my_class.replace(/ *my-input */,''); + var m = attrs.ngModel; + var html = +'
'+ +' '+ +'
'+ +'