I'm trying to insert a dynamic filter according to a field of an object in ng-grid
. I tried in various ways and I could not:
$scope.gridOptions.columnDefs = [
{ displayName: 'entity.tipoPessoa', field: 'tipoPessoa'},
{ displayName: 'entity.id', field: 'id', cellTemplate: '<div class=\"ngCellText\" ng-class=\"col.colIndex()\"><span ng-cell-text>[Insira o trecho de código aqui]</span></div>'},
//...
]:
Code snippet:
{{ row.entity.tipoPessoa == "F" ? row.entity.id | brCpf : row.entity.id | brCnpj }}
{{ row.entity.tipoPessoa == "F" ? "row.entity.id | brCpf" : "row.entity.id | brCnpj" }}
{{ row.entity.tipoPessoa == "F" ? "{{row.entity.id | brCpf}}" : "{{row.entity.id | brCnpj}}" }}
{{ row.entity.tipoPessoa == "F" ? {{row.entity.id | brCpf}} : {{row.entity.id | brCnpj}} }}
None of these worked. What is the right way to do it? Should I try another approach?