I am trying to put together a grid view using bootstrap's grid system. I have a slider that controls how many columns and rows the grid should have, and the grid should adjust to it through databinding. I am having with the column part. I am trying to set my class based on the column selected. If the column count is 2 then I want to use col-lg-6, or 3 I use col-lg-4, and 4 I use col-lg-3. The minimum count is 2, the grid should respond to the changing value and currently it does not. I am not sure if this is an angular problem or I am just doing it wrong.
Here is the jsfiddle: http://jsfiddle.net/8JbXZ/
<body ng-app="gridView" ng-controller="gridViewController">
<div id="sliderContainer">
Rows : <input value="2" type="range" min="2" max="4" id="rowcount" step="1" ng-model="rows"/>
Columns : <input value="2" type="range" min="2" max="4" id="columncount" step="1" ng-model="columns"/>
</div>
<div>rows : {{rows}} columns : {{columns}}</div>
<div class="container">
<div class="row row0">
<div class="chart {{columns === 4 &&'col-lg-3' || columns === 3 && 'col-lg-4' || columns === 2 && 'col-lg-6' || ''}}"></div>
<div class="chart {{columns === 4 &&'col-lg-3' || columns === 3 && 'col-lg-4' || columns === 2 && 'col-lg-6' || ''}}"></div>
<div class="chart {{columns === 4 &&'col-lg-3' || columns === 3 && 'col-lg-4' || ''}}"></div>
<div class="chart {{columns === 4 &&'col-lg-3' || ''}}"></div>
New Fiddle: http://jsfiddle.net/8JbXZ/7/
Sorry I did not know the link doesn't update itself when I update the content. It now works the way I want.