javascript - angular ng-repeat and inline-block -


i have inherited code uses horizontal lists in form:

<ul>   <li>...</li>   <li>...</li> </ul> 

where <li> inline-block. need populate lists ng-repeat:

<ul>   <li ng-repeat="item in items">...</li> </ul> 

to avoid (well-known) gaps between inline-block elements have written either:

<li>...</li><li> ...</li> 

or:

<li>...</li><!-- --><li>...</li> 

but have no idea how achieve ng-repeat! anyone? :)

p.s.: read this. wonder if there's elegant "angular specific" solution.

you can manage them applying css rule:

li{ display: inline-block; margin-right: -4px; } 

or, if don't want use negative margin, can use float: left; instead of inline-block.


however, costlier. solution think using ng-repeat-start , ng-repeat-end below:

<ul>   <li ng-repeat="item in items">...</li><!--   <mydir ng-repeat-end>--></mydir> </ul> 

may need use &gt; instead of > , on. , compile function remove element there remain --> using element.unwrap()

i'm not sure above method work fine you're requiring. try once in project , let me inform.


Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -