Hello,

I am wondering how I should create a probably very simple directive.
Within the directive I want to use the current scope.

I have a table with recurring typical headers:
          <th> <span ng-click="params.sortby='surname'; reverse=!reverse;
                        sortit()">surname</span></th>
          <th> <span ng-click="params.sortby='givenname'; reverse=!reverse;
                        sortit()">givenname</span></th>

see: http://plnkr.co/edit/m7hH3am2w5agv15Dd0Yk?p=preview

I'd like to simplify the HTML and write the table somehow like this with
a directive "sortBy":

<th><span sort-by="surname" sort-by-label="Surname"></span></th>
<th><span sort-by="givenname" sort-by-label="Given Name"></span></th>


Kind regards
Cornelius

-- 
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