Added child routes, and config defined routes
Change-Id: I61c5a49a330a63737312d1eb6077aab02236a44f
diff --git a/src/app/core/nav/nav.html b/src/app/core/nav/nav.html
index 2bcdadd..a1292b8 100644
--- a/src/app/core/nav/nav.html
+++ b/src/app/core/nav/nav.html
@@ -1,8 +1,23 @@
<div class="nav">
<ul>
- <li ng-repeat="route in vm.routes" ui-sref-active="active" ng-class="vm.isRouteActive(route)">
- <a ng-if="route.state" ui-sref="{{route.state}}">{{route.label}}</a>
- <a ng-if="route.url" href="#/{{route.url}}">{{route.label}}</a>
+ <li
+ ng-repeat="route in vm.routes track by $index"
+ ui-sref-active="active"
+ ng-class="vm.isRouteActive(route)">
+ <a ng-if="route.state" ui-sref="{{route.state}}" ng-click="vm.activateRoute(route)">
+ <i ng-if="route.children" class="fa fa-chevron-right"></i>
+ {{route.label}}
+ </a>
+ <a ng-if="route.url" href="#/{{route.url}}" ng-click="vm.activateRoute(route)">
+ <i ng-if="route.children" class="fa fa-chevron-right"></i>
+ {{route.label}}
+ </a>
+ <ul class="child-routes" ng-if="route.children" ng-class="{opened: route.opened}">
+ <li ng-repeat="childRoute in route.children" ui-sref-active="active">
+ <a ng-if="childRoute.state" ui-sref="{{childRoute.state}}">{{childRoute.label}}</a>
+ <a ng-if="childRoute.url" href="#/{{childRoute.url}}">{{childRoute.label}}</a>
+ </li>
+ </ul>
</li>
</ul>
</div>