简体   繁体   中英

How to edit url before routing in angularjs

Actually my angularjs routing is working fine, but now I want to route to different route from the searched url.

ex.: I have two urls that are:

/en/Feedback

/ar/Feedback

These two url should route to the same route below.

.when("/Feedback", {
    templateUrl: "/Scripts/Cms/Feedback.html",
    controller: "FeedBackCtrl"
})

And if possible, I want to get 'en' or 'ar' to a variable before $routeProvider route to the url.

note: en and ar cannot be passed as parameter. It should be in the same format as given in url.

finally i found a way to change the url. I will not prescribe that way... i just modified the "angular-route.js". I just Edit the url before route checking from our set of routes we defined, has happen from "route.js"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM