I need to create my own router like code in angularjs because I need to add routes dynamically using simple plugins system. I have navigation like this:
<ul>
<li><a href="#page1">page1</a></li>
<li><a href="#page2">page2</a></li>
</ul>
and my controller look like this:
app.controller('main', function($scope) {
let set = () => {
this.panel = location.hash.replace(/^#/, '');
};
$(window).on('hashchange', () => {
$scope.$apply(set);
});
set();
});
I will show different panel depend on controller panel property.
but when I click on the link I've got #!#page1 how can I prevent #!# and have #page1 as hash? Or maybe just #!/page1 (but without adding router) because when I'm adding href="page1" I've got normal link to page that don't exists (outside of angular).
$locationProvider.html5Mode(true);in.config()block