I have used recently the ng-view in partial view and it looks much like the use of ng-include. Is there a difference between the two: ng-view directive and ng-include or when is it better to use which?
Not sure when to use ng-view or ng-include
Asked Answered
possible duplicate of How to decide when to use ngView or ngInclude? –
Gourley
#20025601 –
Lederhosen
Basicly ng-View creates a new View which works with States or Routing, saying this view gets his own Controller and Stuff like it would be a html file. And ng-include is if you have like a html template which u need to show on different views and include it to not duplicate code.
So for example you can ng-include your header html where you have your navigation, and you could ng-view a register form or smth where you need it to have its own Route/ State and Controller
© 2022 - 2024 — McMap. All rights reserved.