angularjs - Can't get routeparams individualy -


retrieving return successful cant seem attributes individually` var myapp = angular.module('myapp', ['nggrid', 'ngroute', "nganimate", "ngaria", 'ngmaterial']);

            myapp.config(['$routeprovider', function ($routeprovider)             {                 $routeprovider.                 when('/:energyid/:energychain/:resourceid/:facilityid',                 {                     templateurl: '/content/resourcetemplate.html',                     controller: 'detailscontroller',                     resolve: {                         somedata: function ($route) {                             return $route.current.params;                         }                     }                  }).                 otherwise({                     redirectto: '/param1/param1/param1/param1'                 });             }]);              myapp.controller('detailscontroller', ['$scope', '$routeparams', function ($scope,somedata, $routeparams) {                  //this doesnt work                  $scope.statuslabel = somedata.energychain;                 //but works   $scope.statuslabel = somedata; 

`

 myapp.controller('detailscontroller', ['$scope','somedata','$routeparams', function ($scope,somedata, $routeparams)  

wrong sequence of dependency


Comments