A landing page is often totally different than the look and feel of other pages.
Basically, with the default routing mechanism of angular, index.html
could have an ng-view
in order to display the various pages.
There is not concept of "conditions" with this ng-view.
Indeed, what if I want to specify some navigation bar to all pages but landing page?
Should I "include" a navigation bar to each of those templates, breaking DRY principle?
I did that by using angular-ui-router https://github.com/angular-ui/ui-router/wiki
With Angular UI Router You can define states instead but you need to pub/sub the state back to your navigation component.
Angular ui Router allows you to nest views so you don't need to put the navigation outside of the view which would result in reloading the page being out of your view.
Just a note ui router is using ui-sref directive to navigate instead of ng-href. This could be a lot of work for reforging your project But I believe it worth it.
About changing your Navigation. You can have your navigation wrapped in an ng-if or ng-show directive or you can have a completely different base template on your / , /home state.
Cheers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With