2

So all of my pages use the index.html to render pages and in the index.html, my code is structured so that all views render in the div with the ng-view="" tag as:

  <body>
    <div class="navbar navbar-inverse" role="navigation" ng-controller="indexController" style="border-bottom: #ab2328 3px solid;">
        <div class="container">
            <div class="navbar-header">
                <button class="btn btn-success navbar-toggle" ng-click="navbarExpanded = !navbarExpanded">
                  <span class="glyphicon glyphicon-chevron-down"></span>
                </button>
                <a ng-show="!isSWA" class="navbar-brand" href="http://www.naviabenefits.com" target="_blank"><img style="height: 37px;" src="ppt/assets/navia.png"></a>
                <a ng-show="isSWA" class="navbar-brand" href="http://pebb.naviabenefits.com/" target="_blank"><img style="height: 37px;" src="ppt/assets/navia.png"></a>
            </div>
            <div class="collapse navbar-collapse" collapse="!navbarExpanded">
                <ul ng-show="!isSWA" class="nav navbar-nav navbar-right">
                    <li ng-show="authentication.isAdmin"><a href="#/admin/ppt">admin</a></li>
                    <li><a href="https://www.naviabenefits.com/products-and-services/" target="_blank">products + services</a></li>
                    <li><a href="https://www.naviabenefits.com/about/" target="_blank">about us</a></li>`
                    <li><a href="https://www.naviabenefits.com/testimonials/" target="_blank">testimonials</a></li>
                    <li><a href="https://www.naviabenefits.com/careers/" target="_blank">careers</a></li>
                    <li><a href="https://www.naviabenefits.com/news/" target="_blank">news</a></li>
                    <li><a href="https://www.naviabenefits.com/blog/" target="_blank">blog</a></li>
                    <li><a href="https://www.naviabenefits.com/contact/" target="_blank">contact us</a></li>
                    <li ng-show="authentication.isAuth"><a id="signOut" href="#/logout" >sign out <i class="fa fa-sign-out"></i></a></li>
                </ul>
            </div>
        </div>
    </div>
    <div class="container-fluid">
      <div ng-view="">
      </div>
    </div>
    <div id="footer" role="navigation" ng-controller="indexController">
        <div class="container">
            <div class="footerLinks">
            </div>
        </div>
    </div>
  </body>

So I have a couple of pages that I want to render without the header and footer, but still keep some of the other pathing.

This "plain" page has its own controller and all and my routing for it in my app.js looks like:

$routeProvider.when("/claimReceipt-plain", {
    controller: "claimReceiptController",
    templateUrl: "ppt/views/claims/claimReceipt-plain.html"
});

How can I do this within this index.html and not have the header and footers render, but me more or less, its own page?

Mark
  • 1,812
  • 3
  • 29
  • 51

1 Answers1

0

Define a scope level Boolean variable on the page controller where you don't want the header and use ng-show directive to apply condition on the header div tag.

techprat
  • 375
  • 7
  • 23
  • Sorry I forgot your header is a part of index page which is rendered using main controller so you cannot control controller scope variable from view controllers. May be you should try passing values from view controller(where you don't want header) to main controller setting the display value to false and use it in ng-show. – techprat Aug 02 '16 at 08:23
  • Use this link to see how you can exchange values between controller: https://thinkster.io/a-better-way-to-learn-angularjs/services Sorry couldn't provide code snippet right now. Try this if you don't come up with solution, will try to write a snippet. – techprat Aug 02 '16 at 08:30