Skip to content

Instantly share code, notes, and snippets.

@chrisirhc
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisirhc/4c32d41284734d942706 to your computer and use it in GitHub Desktop.
Save chrisirhc/4c32d41284734d942706 to your computer and use it in GitHub Desktop.
Directive to add space after an ngRepeat element

Directive to add space after an ngRepeat element

To use:

<li ng-repeat="item in items" add-space-after>
</li>
.directive('addSpaceAfter', function () {
return {
// Needs to be higher priority than ngRepeat
priority: 1001,
compile: function (tElement) {
tElement.push(document.createTextNode(' '));
}
};
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment