AngularJS Page loading in div

I have some static html content pages. I want to create an index page that has two divs One for the sidebar menu and one for storing content. When I click one of the menu links in the sidebar, I want to load one of the other static html pages into the contents of the div.

I just can't find the documentation that shows how to do this, so I'm not even sure if this is possible. Can anyone help?

+4
source share
2 answers

You can also use ng-view to configure the routes that will load your templates into your div. This is pretty straight forward and there is a good example @ https://docs.angularjs.org/api/ngRoute/directive/ngView

+5
source

Use ng-include :

 <ng-include src="{string}" [onload="{string}"] [autoscroll="{string}"]> </ng-include> 

http://docs.angularjs.org/api/ng.directive:ngInclude

+3
source

Source: https://habr.com/ru/post/1492698/


All Articles