Advertisement
Guest User

Untitled

a guest
Sep 27th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <a class="waves-effect waves-light btn" my-directive="" on-flag="someFunction" question-id="question">Flag</a>
  2.  
  3. angular.module('myApp').directive('myDirective', function($http) {
  4. return {
  5. restrict: 'A',
  6. scope: {
  7. onFlag: '&onFlag',
  8. questionId: '='
  9. },
  10. link: function(scope, element, attrs) {
  11. return element.click(function() {
  12. console.log(scope);
  13. console.log(scope.questionId);
  14. });
  15. }
  16. };
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement