Search code examples
angularjsfooter

How to setup header and footer when using angularjs?


How to set header and footer on an html page when using angularjs? Is their a way so that angular knows that these are header and footer and positions them at top and bottom of page?


Solution

  • Either define your header and footer html in your main layout (index.html) or include it using ng-include:

    <div ng-include="'header.html'"></div>
    <div ng-view></div>
    <div ng-include="'footer.html'"></div>
    

    Positioning is determined by CSS.