I have a header.html
file. When a div
inside it is clicked I want to switch to another view, let's say main.html
. I used:
window.location("main.html");
How can I use ng-include
to do the same?
For switching between views in angularJS one should use routing. You can use the ngRoute or the ui-router. You should ideally not do that with an ng-include.