X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=app%2Fjs%2Fdirectives.js;h=ac273fe5909f09ae46ba46a316b2cc163f099fda;hb=3b3aab3a072bc2ad0dc4bc18f951948d02045cde;hp=9fc16cc4cbc0ad7bf164726da5c3d9f267c92204;hpb=11e1695154127e28964687149bd24a8922bc38b6;p=angular-drzb diff --git a/app/js/directives.js b/app/js/directives.js index 9fc16cc..ac273fe 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -8,4 +8,121 @@ angular.module('myApp.directives', []). return function(scope, elm, attrs) { elm.text(version); }; - }]); + }]). + directive('myInput', function() { + return { + 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 = '
' + +'' + +''+ +' '+ +'
'+ +' '+ +'
'; + + 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 = +'
'+ +' '+ +'
'+ +'