How do I dynamically define a function to call with ng-click in AngularJS directive template?