JavaScript AngularJS route not resolved on page load angularjs route resolve redirect,angularjs route resolve,angularjs route resolve

I try to implement a AngularJS router into my application. So I have define one route (in angular.module('MyModule').config()) :

$routeProvider
  .when('/:stepId?', {
          templateUrl: EditorApp.webDir + 'bundles/innovapath/angularjs/Step/Partial/step-form.html',
          controller: 'StepFormCtrl',
          controllerAs: 'stepFormCtrl',
          resolve: {
              step: [
                  '$route',
                  'PathService',
                  function($route, PathService) {
                      var step = null;

                      // Retrieve the step from route ID
                      if ($route.current.params && $route.current.params.stepId) {
                          step = PathService.getStep($route.current.params.stepId);
                      }

                      return step;
                  }
              ],
              inheritedResources: [
                  '$route',
                  'PathService',
                  function($route, PathService) {
                      var inherited = [];

                      var step = PathService.getStep($route.current.params.stepId);
                      if (angular.isDefined(step) && angular.isObject(step)) {
                          var path = PathService.getPath();

                          // Grab inherited resources
                          inherited = PathService.getStepInheritedResources(path.steps, step);
                      }

                      return inherited;
                  }
              ]
          }
    })
    .otherwise({
        redirectTo: '/:stepId?'
    });

I'm also listening $routeChangeStart event, but it's not fired when my page is loaded.

I can't figure out why the route is not resolved. Moreover, when I refresh the page with F5, I got the same problem.

When I use internal link in my application the route resolution works perfectly.

Any idea ?

Answer:1

I am using JsPDF and want to create pdf from content inside a Section tag. i have tryed alot of guides but noone seam to work, and due to lack of demo code, i see no other alternative than try my luck ...

I am using JsPDF and want to create pdf from content inside a Section tag. i have tryed alot of guides but noone seam to work, and due to lack of demo code, i see no other alternative than try my luck ...

  1. jspdf creates empty pdf
  2. jspdf empty pdf

I have Icon with me and one scope.id and I am assigning different color code each time with Icon . Suppose angular.module('myAppp').controller('myCtrl',function(){ scope.id=[0,1,2,3]; //...

I have Icon with me and one scope.id and I am assigning different color code each time with Icon . Suppose angular.module('myAppp').controller('myCtrl',function(){ scope.id=[0,1,2,3]; //...

  1. generate same random numbers python
  2. generate same random numbers matlab
  3. generate same random numbers java
  4. generate same random numbers c
  5. generate same random number
  6. generate same random sequence
  7. r generate same random number
  8. how to generate same random numbers in python
  9. how to generate the same random numbers in python

I am using the Bootstrap CSS and JS libraries in my site and the following code: $(function(){ $("#nav-login-btn").click(function(){ if($("#togglesection").not(":visible")) { $("#nav-...

I am using the Bootstrap CSS and JS libraries in my site and the following code: $(function(){ $("#nav-login-btn").click(function(){ if($("#togglesection").not(":visible")) { $("#nav-...

i would like to add comfirmationbox in durandal.js i wrote following to code , but it is not returning Yes or NO define(['services/logger', 'durandal/plugins/router', 'durandal/app'], function (...

i would like to add comfirmationbox in durandal.js i wrote following to code , but it is not returning Yes or NO define(['services/logger', 'durandal/plugins/router', 'durandal/app'], function (...