I am working on an angularJS single page application that loads views per click.
My login and Index are combined in one HTML file. I have managed it using ng-show and ng-if directives.
The process is as follows: Index.html and IndexController.js: The login page has a ng-show="!isLogin" condition, and if the user is authenticated, isLogin will be set to true.
https://i.sstatic.net/nFFd4.jpg
This allows me to access my home page. The code looks like this:
<section id="content">
<div ng-view>
</div>
</section>
Next, there is a default.html which contains the initial page to be displayed after 'isLogin' becomes true, with the DashboardController.js as its controller.
https://i.sstatic.net/aTPiR.jpg
However, the controller does not run automatically unless I click the button on the navigation bar.
https://i.sstatic.net/4oBbj.jpg
For example, the "Overdue Bills" section does not load until I click on "Dashboard" in the NavBar.
So, how can I make my controller run right after logging in? Any assistance would be greatly appreciated.
This project is for educational purposes.
Thank you.
EDIT: DashboardController.js
(Controller code goes here)
Index.html
(HTML code goes here)
EDIT2: for NTP
(Additional functionality code snippet goes here)