Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I have a table that contains a boolean column for each rows. I want to implement a checkbox which is for filtering that will be a predicate of the boolean column. I know there's nice example to achieve this https://github.com/lorenzofox3/Smart-Table/issues/387 but it's not working for me.

I've put following element to the html:

<tr>
    <custom-check predicate="myColumn"></custom-check>
</tr>

And JS:

app.directive('customCheck', function () {
    return {
        restrict: 'E',
        scope: {
            predicate: '@'
        },
        require: '^stTable',
        template: '<input type="checkbox" ng-model="sel" ng-change="change()"/>',
        link: function (scope, element, attr, ctrl) {
            scope.change = function change () {
                // I guess I need to make ajax call here 
                //ctrl.search(scope.sel, scope.predicate);
            }
        }
    }
});

But it produces following error to Firebug console.

Error: [$compile:ctreq] http://errors.angularjs.org/1.2.14/$compile/ctreq?p0=stTable&p1=customCheck

What's wrong? Any references or working example would be highly appreciated.

share|improve this question
2  
I used this example exactly like your code, and it worked for me, your angular version is old, try to update it – Rafael Zeffa Nov 27 '15 at 11:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.