Sha256: eb28e35db64a936b13b57d56f63226a7fb3bfb3ccf383830936265c04b226925
Contents?: true
Size: 802 Bytes
Versions: 23
Compression:
Stored size: 802 Bytes
Contents
angular.module('AgileProxy').directive('appEnhancedFormElement', function ($rootScope, $compile, DomIdService) { return { restrict: 'A', scope: true, link: function (scope, element, attrs) { var label, localScope; if (element.attr('id') === undefined) { element.attr('id', DomIdService.nextId()); } localScope = $rootScope.$new(true); angular.extend(localScope, { elementId: element.attr('id'), labelText: attrs.label }); label = $compile('<label class="control-label" for="elementId">{{labelText}}</label>')(localScope); element.wrap('<div class="form-group">'); element.parent().prepend(label); } }; });
Version data entries
23 entries across 23 versions & 2 rubygems