Wednesday, 15 April 2015

Sharing partial pages between views in AngularJS -


I have a classic angeljs application, which is routed with multiple views, each person has their own controller. There are pages that are very different from other people, so the amount of shared HTML between me is low:

  & lt; Html & gt; & Lt; Top & gt; & Lt ;! - Typical header links - & gt; & Lt; / Head & gt; & Lt; Body ng-app = "next" & gt; & Lt; Div class = "div_view" ng-view & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

But now, I have a lot of ideas with the same header and I am surprised that they have a way to share the same headers without changing this file, because I still have Some pages are basically, I am looking for a "control" which I can share among my thoughts, so there is no need to copy / paste my header in each header.

I'm pretty sure that Angulales has a way to do this, but I did not find my answer on Google, please tell me the name of the component I am looking for?

Thank you!

If you want your header to appear on certain pages, you can do the following:

a. Make a directive of your header and include this directorate in your desired template.

b Make an instruction for your header, place it outside your view and hide / show it on some pages. For example, this $ locationCchangeSuccess can be done by hearing the angular incident.


No comments:

Post a Comment