search

Home  >  Q&A  >  body text

angular.js - How does angularjs use ui-view to implement the 404 login registration page?

Beginner to angularjs 1

Write

below index.html
// head css
<body ng-app>
    <p ui-view='nav'></p>
    <p ui-view='sidebar'></p>
    <p ui-view='content'></p>
    // js
</body>

If you log in, you can do this on this page. But for example, login and 404 page, I don’t need nav or sidebar

Should I put one on top of these three ui-views, or write one on top of the body?
Or should I use a variable, ng-if to hide nav or sidebar??
Or should I leave index.html aside and create a separate 404.html register.html, but isn’t this application a SPA?

为情所困为情所困2799 days ago560

reply all(2)I'll reply

  • 黄舟

    黄舟2017-05-15 17:04:36

    Just have a <p ui-view></p>, and configure when to go to the 404 page in the routing.

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-15 17:04:36

    Main page

    <body ng-app>
        <p ui-view="main></p>
        // js
    </body>

    Configure the corresponding route for page jump

    reply
    0
  • Cancelreply