-->

How to create a space between angular ng-repeated

2019-09-10 02:17发布

问题:

The code is:

.container
  my-directive(ng-repeat="item in items", item="item")

My goal is to use that space with justify to create an evenly spaced grid of an unknown number of divs.

回答1:

It seems the issue is with ng-repeat. Here's a jade solution:

.container
  my-directive(ng-repeat-start="item in items", item="item")
  span(ng-repeat-end) #{' '}

Here's an equivalent solution for HTML I found: https://stackoverflow.com/a/19507046/4760334