Reputation: 219
I am building angular single page application with ui-routing. I need to hide the url after the domain from end user.It shuld not affect any other feature like accessing url or anything, but just want to hide the state changes from end user. Which is the best way to do that?
Upvotes: 0
Views: 71
Reputation: 1246
you can do that with ui-router library by creating the URL-less states and navigate to them ,like this:
angular.module('app', ['ui.router'])
.config(function ($stateProvider) {
$stateProvider
.state("home", {
url: "",
template: "<a ui-sref='next'>Next page</a>"
})
.state("next", {
template: "<a ui-sref='home'>Back</a>"
});
});
Upvotes: 1