I'm working in the AngularJS environment.
I have the following table of chart images which I'm converting to an ng-repeat.
I've managed to assign ONLY those records I want to display but using GadgetIconsCtrl below. Now I need to display two <td> elements per row.
How do I display two <td> elements per row using ng-repeat ?
<table id="gadgets" class="propertyTable clickable_row">
<tr>
<th>Type</th>
</tr>
<tr>
<td data-url="chart_treelist">
<img data-draggable id="chart_treelist" src="images2/table.png" title="Tree Grid" alt="Hierarchy Grid" width="64" height="64">Grid
</td>
<td data-url="{chart_pivot}">
<img data-draggable id="chart_pivot" src="images2/pivottable.png" title="Pivot Table" alt="Pivot Table" width="64" height="64">Pivot
</td>
</tr>
</table>
When the user launches the modal window in which this table is embedded,so I need to immediately highlight a specific <td> element.
Here's an example of a few $scope.widgets chart properties:
$scope.widgets[0].title = "Bar Chart"
$scope.widgets[0].gadgetType = "chart"
$scope.widgets[0].chartType = "bar"
So far I'm working with ng-repeat, but having trouble appying the filter
Here's the ng-repeat and the controller attached to it:
(function () {
'use strict';
angular.module('rage')
.controller('GadgetIconsCtrl', ['$rootScope', '$scope', icons]);
function icons($rootScope, $scope) {
var gadicons = this;
gadicons.widgetSubset = null;
if ($scope.widget.gadgetType == 'chart' && $scope.widget.chartType == 'bar') {
gadicons.widgetSubset = _.filter($scope.widgetDefs, function (item) {
return item.chartType == 'bar' || item.chartType == 'column';
});
}
}; // end of gridSettings()
})();
<table ng-controller="GadgetIconsCtrl as gadicons">
<tr ng-repeat="widget in gadicons.widgetSubset" ng-class="" >
<td>
<img data-draggable ng-src="{{widget.initImage}}" title="{{widget.title}}" alt="Hierarchy Grid" width="64" height="64">{{widget.title}}
</td>
</tr>
</table>
Your advice is greatly appreciated.
regards, Bob
ng-repeatthat way you would not need to add on every line.