return function(scope, elm, attrs) {
elm.text(version);
};
- }]);
+ }]).
+ directive('myInput', function() {
+ return {
+ restrict: 'C',
+ compile: function(element, attrs) {
+ element.replaceWith('<div class="'+attrs.class+'"><label for="'+attrs.ngModel+'">' + attrs.placeholder + '</label><input type="'+ ( attrs.type || 'text' ) +'" name="'+attrs.ngModel+'" ng-model="' + attrs.ngModel + '" ng-required="' + attrs.ngRequired + '" placeholder="' + attrs.placeholder + '" /></div>');
+ }
+ };
+ });