Data Table Overview:
--------------------------------------------------------------------
| ID | PARENT ID | CATEGORY | URL |
--------------------------------------------------------------------
| 1 | 0 | Programming | programming |
--------------------------------------------------------------------
| 2 | 1 | Logic | programming/logic |
--------------------------------------------------------------------
| 3 | 1 | Object-Oriented | programming/oop |
--------------------------------------------------------------------
| 4 | 2 | PROLOG | programming/logic/prolog |
--------------------------------------------------------------------
| 5 | 2 | LISP | programming/logic/lisp |
--------------------------------------------------------------------
| 6 | 3 | JAVA | programming/oop/java |
--------------------------------------------------------------------
| 7 | 3 | C# | programming/oop/csharp |
--------------------------------------------------------------------
Page Configuration:
<html>
<body>
<nav ng-controller="navController">
<ul ng-repeat="menuItem in menuItems">
<li><a href="#/{{menuItem.URL}}">{{menuItem.Title}}</a></li>
</ul>
</nav>
<div ng-view>
</div>
</body>
</html>
Context Explanation:
The navigation menu is dynamically generated from database information, providing drill-down functionality to display one level at a time.
The initial level showcases one menu item:
<ul>
<li>
<a href="#/programming">Programming</a>
</li>
<ul>
Upon clicking the "Programming" link, subsequent children of that menu item are revealed:
<ul>
<li>
<a href="#/programming/logic">Logic</a>
</li>
<li>
<a href="#/programming/object-oriented">Object-Oriented</a>
</li>
</ul>
Key Assumptions:
(1) Each menu item corresponds to a related partial. For instance, "Object-Oriented" links to its partial at: "/partials/objectoriented.html".
(2) The function GetMenuItemsByUrl(url) returns all children of a menu based on the provided url. For example, passing "programming/logic" retrieves rows 4 and 5 as children of row 2. This function is accessible via /api/GetMenuItemsByUrl/:url
Intended Behavior:
If the user navigates to: mywebsite.com/#/programing
(1) The displayed nav should include:
- Logic
- Object-Oriented
(2) The template loaded in the view should be: /templates/programming.html
Question Raised:
While I understand how to render views with the route through the router, my query pertains to passing the current url to the navController for a rebind request?