angularjs - $state, $stateParams, getting undefined object -


i getting unexpected results both methods.

i have $state configed

    $stateprovider                 .state('status', {                   url: "/status/:payment",                   controller: 'questctrl',                   templateurl: "index.html"                 }); 

and on controller have:

    angular.module('quest').controller('questctrl',function($scope,$stateparams,$state){       console.log($stateparams.payment); // undefined       console.log($state); // object {params: object, current: object, $current: extend, transition: null}  } 

i used $stateparams in other projects , worked can't figure out going on here..

        ['$scope','$stateparams','$state', function($scope,  $http,          $stateparams, $state) 

the names of services don't match variables.

so $http $stateparams service, $stateparams $state service, , $state undefined.

my advice: stop using array notation, clutters code , frequent source of bugs. instead, use ng-annotate part of build procedure, it, correctly, you.


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -

jdbc - Not able to establish database connection in eclipse -