0
使用URL〜/列表/結果/ 1256angularjs路線和param和控制器
我的代碼在一個文件中
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
});
你確定ListController正在加載嗎?你把它放在一個console.log? – frosty
是的,控制器然後在頁面上加載數據 –