I am making a web page and there are different types of users.Dealer and worker.Only worker can access index.html page and only dealer can access odeme.html.I did this. index.html=http://localhost:8080 odeme.html=http://localhost:8080/odeme
I'm a dealer and on the odeme.html page if i change the url,i can access index.html.I solved this problem with ajax call and location.href.But first index page appears then odeme.html appears.I want the odeme.html page to appear without the index page being displayed.How can i do?
Try to use a guard for every role in your app.
Read more here about Router CanActivate
Also you can find a full implementation here