I'm using AngularJS, ng-table and coffeescript together and would like to create a multiple template filter within coffeescript and pass it into my angularjs template.
I have a name & surname combined column which I would like two filters for 'name' and 'surname'.
So far I have it working like so;
<td data-title="'Customer'" sortable="'fullname'"
filter="{'name_cont': 'text', 'surname_cont':'text'}" >
But I would like to define this filter in my AngularJS controller like so
$scope.nameFilterDef = {
name: {
id: "text",
placeholder: "Name"
},
surname: {
id: "text",
placeholder: "Surname"
}
}
And clean up my template by using that filter like so;
<td data-title="'Customer'" sortable="'fullname'"
filter="nameFilterDef" >
When I call the filter like this though no filter boxes appear.
Update
If I put {{nameFilterDef}} on the page I can see my filter hash getting passed in.
filter="{{nameFilterDef}}"
? – ParaplegianameFilterDef
in your template. If it turns up empty, means that the template$scope
is not as you expect it to be. Could you create a plunker or jsFiddle? – Suter