0

use url ~/list/result/1256

my code in one file

 App.config(["$routeProvider", function ($routeProvider) { $routeProvider.when("/list/result/:param", { controller: "ListController" }); }]); App.controller("ListController", ["$scope", "$routeParams", "$http", function ($scope, $routeParams, $http) { I want to get "1256" here, but $routeParams - empty, why, what am I doing wrong }); 
2
  • Are you sure that the ListController is loading? Has you put a console.log in it? Commented Jul 10, 2013 at 15:26
  • Yes, the controller then loads the data on the page Commented Jul 10, 2013 at 16:10

1 Answer 1

1

First of all, your question is incomplete. You have not posted the partial that loads when you navigate to the URL "/list/result/1256", i.e. your templateUrl is missing. Secondly, you have not posted how you are trying to extract the param in ListController.

Per my knowledge,

var param = parseInt($routeParams['param'], 10); 

should help you extract the param.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.