具有波斯字符,但网址如下:
localhost:53297/#/Item/News/1-1-1-3?title=%D8%B1%D9%88%D9%86%D9%85%D8%A7%DB%8C%DB%8C%20%D8%A7%D8%B2%20%D8%AA%D8%A8%D9%84%D8%AA%20%D9%87%D8%A7%DB%8C%20%D8%B4%D8%B1%DA%A9%D8%AA%20HP
我想要这样的网址:
localhost:53297/#/Item/News/1-1-1-3?title=طلا-نقره
答案 0 :(得分:3)
尝试使用decodeURIComponent(yourUrl)
在全球范围内你可以使用这样的东西
$rootScope.$on('$locationChangeStart', function (e, newUrl, oldUrl) {
$location.$$absUrl = decodeURIComponent(newUrl);
});
答案 1 :(得分:2)
答案 2 :(得分:0)
我修正了答案:
var newUrl = persianJs(searchQuery).fixURL().toString();
$rootScope.$on('$locationChangeStart', function (e, newUrl, oldUrl) {
$location.$$absUrl = decodeURIComponent(newUrl);
});