Hi Chocola…,

do something like this:

    app.directive('se-singletap', ['$parse',
        function($parse) {
            return {
                restrict: 'A',
                compile: function ($element, attr) {
                    var fn = $parse(attr['se-singletap']);
                    return function ngEventHandler(scope, element) {
                        element.on('singletap', function (event) {
                            scope.$apply(function () {
                                fn(scope, {$event: event});
                            });
                        });
                    };
                }
            };
        }
    ]);

That is exactly the same thing as what the angular source code does. You 
can create those directives from an array, similar to what the source code 
does.

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

Reply via email to