I have a form that is using markup from Bootstrap, like the following:
angular.module('formComponents', [])
.directive('formInput', function() {
return {
restrict: 'E',
compile: function(element, attrs) {
var type = attrs.type || 'text';
var required = attrs.hasOwnProperty('required') ? "required='required'" : "";
var htmlText = '' +
'' +
'' +
'' +
'' +
'';
element.replaceWith(htmlText);
}
};
})