How to add conditional when showing data in ui-grid
cellTemplate below:
$scope.status = ['Active', 'Non Active', 'Deleted'];
$scope.gridOptions = {
columnDefs: [{
field: 'code'
}, {
field: 'name'
}, {
field: 'status',
cellTemplate: '<div>{{status[row.entity.status]}}</div>'
}]
};
The expected result should be row status show Active/NonActive/Deleted
.
Here is the plunker
Thanks in advance.
getExternalScopes()
is not working usegrid.appScope
instead, like this:var statusTemplate = '<div>{{grid.appScope.states.showMe(row.entity.status)}}</div>';
– Opus