Hi Sander,

thanks for the hint.
My missing information was, that I can access the current scope with
"scope.".

Now I did it this way:

myApp.directive("piSortBy", function(){
    return {
        restrict: 'A',
        link: function(scope, element, attr) {
            element.on('click', function() {
                scope.params.sortby='active';
                scope.reverse=!scope.reverse;
                scope.getTokens();
            });
        }
    }
});

Calling it in the HTML.

<th pi-sort-by="active">active</th>
<th pi-sort-by="window">window</th>
<th pi-sort-by="description">description</th>
<th pi-sort-by="failcount">failcounter</th>
<th pi-sort-by="maxfail">maxfail</th>
<th pi-sort-by="otplen">otplen</th>

As I am doing Ajax request the actual sorting is done in scope.getTokens().

Thanks a lot and kind regards
Cornelius


Am 17.01.2015 um 12:02 schrieb Sander Elias:
> Hi Cornelius,
>
> I builded a sample <http://goo.gl/UDw0cM> that implemeted something
> similair quite a while ago.
> Have a look at that, and if you still have questions, don't hesitate
> to ask them!
>
> Regards
> Sander
> -- 
> You received this message because you are subscribed to the Google
> Groups "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected]
> <mailto:[email protected]>.
> To post to this group, send email to [email protected]
> <mailto:[email protected]>.
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to