Using row values ​​in an ng-grid cell columnTemplate

I am trying to add a column that has a link to another page (this is an ng-grid table). This link contains one of the string values

I tried something like this:

$scope.columns = [ {field:'id', displayName:'#'}, {field:'name', displayName:'Name'}, {field:'view', displayName:'Action', cellTemplate: '<a href="http://foo.com/person/' + {row.getProperty(col.id)} + '">[View Details]</a>'} ]; 

But it doesn’t work, any ideas?

+6
source share
4 answers

Expression should be

{{row.getProperty(col.id)}}

or

{{row.getProperty(\'id\')}}

+7
source

or you can

 {{row.entity[\'id\']}} 
+2
source

You can use the ng-grid COL_FIELD property:

 {{COL_FIELD}} 

For instance:

 cellTemplate: '<div class="ngCellText">{{COL_FIELD | date}}</div>' 
0
source

try the following:

 cellTemplate : href="https://localhost:8082{{row.entity.ImgLink}}" 
0
source

All Articles