javascript - binding html in angularjs grid cell template -


i new angular js. have read question before conditional cell template in ui-grid angularjs , absolutely worked me, wondering how display html button tag instead of text, because when trying change html, display html text

thanks , sorry because of bad english

js file

var columndefs = [     {         field: 'action',         displayname: label.action,         width : 175,         enablecelledit: false,         celltemplate: '<div>{{grid.appscope.states.showme(row.entity.j_code, row.entity.branch_cd)}}</div>',                 }];  scope.gridoptions.columndefs = comlumndefs; $scope.states = {     showme: function(j_code, branch_cd) {         template = "<button class='btn-small btn-green btn-add'>add</button>";         if (j_code != "" && branch_cd != "") {             template += "<button class='btn-small btn-green'>copy</button>";         }         return template;     } }; 

html file

<div id="grid1" class="gridstyle" ui-grid="gridoptions" external-scopes="states" ui-grid-pinning ui-grid-resize-columns ui-grid-pagination ui-grid-edit ui-grid-row-edit ui-grid-cellnav ui-grid-selection ui-grid-exporter></div> 

i not know if ve found asnwer or not there others visit find answer.

 .columns(c =>    {     c.add().datafield("give name").celltemplate("<input type=button>");    } 

you can add checkbox or other functions type.


Comments