Is it possible to use a template inside a template? I keep getting a black screen after loggin in when using templates within templates. I want to display the app without menus on the login screen, but I want to display menus after they log in. Please advise.
SAMPLE BEFORE LOGIN
<ion-nav-view name='display'>
<div>Login Form</div>
</ion-nav-view>
SAMPLE AFTER LOGIN
<ion-nav-view name='display'>
<div>Left Menu Template</div>
<ion-nav-view name='content'>
<div>Page Content</div>
</ion-nav-view>
</ion-nav-view>
The problem boils down to not being able to have 2 ion-nav-views. Using ngInclude causes my application to have to use $window.location.reload() whenever a user logs out because ionic/angular caches the ngInclude view and doesn’t honor the ng-show attribute. I’m trying to use side menus when logged in and not show any title or menus when logged out.
I could take the user to another screen. That’s a good thought. I suppose I could use index.html for the login screen and menus.html for the authenticated users.
I should have explained that the menus are side menus. Trying to get side menus to show and hide based on authentication is not easy for me. You’ll likely run into the issue of having 2 ion-nav-view tags. One ion-nav-view tag for the base template and one ion-nav-view tag in your side menu. You can’t have 2 ion-nav-views nested. This is the heart of the problem.
and you can have ion-nav-views nested you need to use named once.
the first <ion-nav-view></ion-nav-view> is in the body
the next is in the event-menu template <ion-nav-view name="menuContent"></ion-nav-view>
you could even have more but then it starts to get messy
i hope this did help if not could you prove more information.
Perfectly done. I was getting messed up on the nested states. Looks like you can have nested states, just not named nested states? I’ll keep experimenting. Thanks!