Sha256: 95f376c91759c2c50eddb8d2525fbdcf81618fe6dd7e02fe385b0c481975d7dc
Contents?: true
Size: 1.16 KB
Versions: 12
Compression:
Stored size: 1.16 KB
Contents
I"›(function() { this.app.directive('repeaterField', [ '$compile', '$timeout', function($compile, $timeout) { return { restrict: 'A', scope: true, link: function($scope, $el, $attrs) { var $rows, template; $rows = $('.rows', $el); template = $('.template', $el).text(); $scope.addRow = function() { var $dom, $row, uid; uid = Math.uid(); $row = $(template); $row.attr('data-uid', uid); $rows.append($row); $dom = $("[data-uid='" + uid + "']", $rows); $compile($dom)($scope); $timeout(function() { return $dom.trigger('init.fndtn'); }); return true; }; if (!$rows.children().length) { return $scope.addRow(); } } }; } ]); this.app.directive('repeaterRow', function() { return { restrict: 'A', scope: true, link: function($scope, $el, $attrs) { return $scope.removeRow = function() { $el.remove(); return true; }; } }; }); }).call(this); :ET
Version data entries
12 entries across 12 versions & 2 rubygems