Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <a class="waves-effect waves-light btn" my-directive="" on-flag="someFunction" question-id="question">Flag</a>
- angular.module('myApp').directive('myDirective', function($http) {
- return {
- restrict: 'A',
- scope: {
- onFlag: '&onFlag',
- questionId: '='
- },
- link: function(scope, element, attrs) {
- return element.click(function() {
- console.log(scope);
- console.log(scope.questionId);
- });
- }
- };
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement