3

I am using carousel from ui.bootstrap and for that i need to use ng-touch. When i inject my app with ngTouch it brakes some things, inputs in mobile can't be clicked. How can i inject specific controller, i have tried to make two different modules but i have to load the module with ngTouch inside ng-app module and again that brakes things.

angular.module('appModule',['carouselModule'])
angular.module('carouselModule',['ngTouch','ui.bootstrap'])
Honchar Denys
  • 1,408
  • 4
  • 29
  • 54
  • You can't, angular modules don't work like this, you need to focus the question on how to remedy ngTouch side effects. – Estus Flask Jul 15 '15 at 14:00

1 Answers1

3

With the guide of @estus, i have found the solution.

directives.stopEvent=function() {
    return {
        restrict: 'A',
        link: function(scope, element, attr) {
            element.on(attr.stopEvent, function(e) {
                e.stopPropagation();
            });
        }
    };
}

and in the html for example:

<div id="topbar" stop-event="touchend">...</div>
Honchar Denys
  • 1,408
  • 4
  • 29
  • 54