- Second we define on image object and off image object and string containing the URL of the "off" version.
- Then we create the menu items, label items and sub-menu items. If we wish we can use images also.
- Then we need to define our own global variables that will be used by the menu. Using global goes against oops design but makes sharing data easier.
- Create the menubar object, adding the menu labels and writing menubars.
- Create menu object, adding menu items and writing menus.
- Hiding and displaying the menus and attaching stylesheet.
When the page is loaded in the browser, following action takes place:
AngularJS scans through the HTML to look for AngularJS applications and views. Once view is located, it then connects that view to the corresponding controller function.
Then, AngularJS executes the controller functions. It then renders the views with data from the model populated by the controller. The page is ready.