1 Reply Latest reply on May 13, 2014 9:36 AM by Ken Finnigan

    AngularJS routing

    Bernard Labno Master

      Hi, how do you setup your project so that AngularJS routing works with different context path (Arquillian can create several deployments with different context paths i.e. with name of the test class).

       

      (function ()
      {
          'use strict';
      
      
          var module = angular.module('products', ['ui.slider']);
      
      
         module.config(['$routeProvider', function ($routeProvider)
          {
              //list
              var productListRoute = {controller: 'ProductListCtrl', templateUrl: 'app/products/productList.html'};
              $routeProvider.when('/products', productListRoute);
              $routeProvider.when('/products/featured', productListRoute);
              $routeProvider.when('/products/sale', productListRoute);
              $routeProvider.when('/products/category/:categoryPermalink', productListRoute);
              $routeProvider.when('/products/manufacturer/:manufacturerPermalink', productListRoute);
              $routeProvider.when('/products/shop/:shopPermalink', productListRoute);
              $routeProvider.when('/products/shop/:shopPermalink/category/:categoryPermalink', productListRoute);
      
      
              //details
              $routeProvider.when('/product/:productPermalink', {controller: 'ProductDetailsCtrl', templateUrl: 'app/products/productDetails.html'});
      
      
              //checkout
              $routeProvider.when('/checkout', {controller: 'CheckoutCtrl', templateUrl: 'app/cart/checkout.html'});
          }]);
      })();
      
      

       

      kenfinni Do you attach some filter that routes some paths to index.html (main application page)?