【发布时间】:2016-12-15 15:44:26
【问题描述】:
我想要一个网址,例如
/1234?labels=label1,label2,label3
我通过使用 routeParams 得到 1234。我知道我可以使用$location.search().labels 来获取label1, label2, label3。但是,我想检索一个数组[label1, label2, label3]。传入的标签可能多于 3 个。
app.config(function (toastrConfig, $routeProvider, $locationProvider) {
angular.extend(toastrConfig, {
allowHtml: true,
timeOut: 3000,
positionClass: 'toast-top-right',
preventDuplicates: true,
progressBar: true
});
$routeProvider
.when('/:type/:id', {
templateUrl: 'app/main/main.html'
})
$locationProvider.html5Mode(true);
});
任何帮助将不胜感激!
【问题讨论】:
标签: angularjs url url-parameters