Gustavo Gabriel Gustavo Gabriel - 1 year ago 59
AngularJS Question

Split an object properties in two columns

I wanna split an object properties in two columns, when I was using bootstrap I was able to do it with the clearfix class like so:

<div class="clearfix" ng-if="$index % 12 == 0"></div>

But now I am using angular material and I wanna know how do it. Below fiddle for testing and better explanation:

<div layout="column">
<span ng-repeat="(key,value) in obj">
{{key}} : {{value}}

Appreciate any help.

Answer Source

following will do what you want

<div layout="row" layout-wrap>
  <span flex=50 ng-repeat="(key,value) in obj">
    {{key}} : {{value}}

Always add flex to children of layout. Getting used to the layout rules/config takes a bit of time


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download