javascript - How to use AngularJS 1 in Ag-Grid filters? -


i want create filter ag-grid 5.2.0 in angularjs. here code:

    var columndefs = [         {headername: "test1", field: "test1", filter: mycustomfilter},         {headername: "test2", field: "test2"},     ];               vm.gridoptions = {         enableserversidesorting: true,         enableserversidefilter: true,         columndefs: columndefs,         datasource: getdatasource(),         paginationpagesize: 10,         rowmodeltype: 'pagination'     };      // class function.     function mycustomfilter() {}      // mandatory methods     mycustomfilter.prototype.init = function (params) {};     mycustomfilter.prototype.getgui = function () {return "<div>{{ 'testkey' | translate}}</div>"};     mycustomfilter.prototype.isfilteractive = function() {return true;};     mycustomfilter.prototype.doesfilterpass = function (params) { return true;};     mycustomfilter.prototype.getapi = function () {}; 

the problem angularjs not evaluate translate filter. how can add angularjs elements ag-grid filter?

i have figured out solution:

function getgui() {     var filterscope = $rootscope.$new(true);     var filter = $compile("<div>{{ 'testkey' | translate}}</div>")(filterscope);     filterscope.$digest();     return filter[0]; }; 

Comments