3

When i add ngTouch to my app which use ngRoute that's not seems to work, but when i remove ngRoute it works... I don't know why

var app = angular.module('app', ['ngTouch', 'ngRoute']).run(function() {
FastClick.attach(document.body)});

app.config(function($routeProvider){
    $routeProvider
        .when('/home', {templateUrl: 'partials/home.html'})
        .when('/videos', {templateUrl: 'partials/videos.html'})
        .when('/recettes', {templateUrl: 'partials/recettes.html'})
        .when('/candidats', {templateUrl: 'partials/candidats.html'})
        .when('/jury', {templateUrl: 'partials/jury.html'})
        .when('/photos', {templateUrl: 'partials/photos.html'})
        .when('/quiz', {templateUrl: 'partials/quiz.html'})
        .when('/about', {templateUrl: 'partials/about.html'})
        .when('/live', {templateUrl: 'partials/live.html'})
        .otherwise({redirectTo: '/home'})
});

and my html

<html ng-app="app">
...
<section class="view" ng-view ng-swipe-right="collapse = 0"> 
...
</section>
...
</html>

The ng-swipe-right don't work with ngRoute but it works without it...

Visakh B Sujathan
  • 229
  • 1
  • 4
  • 25
KimiBst
  • 41
  • 4
  • I'm going to guess that your problem is the fact that you're using both `ngTouch` and `FastClick`. The purpose of `ngTouch` is to provide the same functionality that `FastClick` provides, so you shouldn't need to use them both. Have you tried removing your `.run()` block where you initialize `FastClick`? – tennisgent Jul 21 '14 at 14:40
  • having the same problem without using .run() – Joe Saad Dec 17 '14 at 20:29
  • Possible duplicate of [AngularJS - using ngTouch redirection with ngRoute doesn't work with href and ng-click attribute](http://stackoverflow.com/questions/30885866/angularjs-using-ngtouch-redirection-with-ngroute-doesnt-work-with-href-and-ng) – Paul Sweatte Sep 20 '16 at 06:11

0 Answers0