<ul> @foreach (var child in parent.Children) { <li class="@MenuHelper.SetChildClass(child, ViewBag) childNode"> <a href="@child.NavigateUrl">@child.Text</a> </li> } </ul>Now, we also have an ability to add items to the Favorites menu. All that nice code was developed by my colleague.
(function () { 'use strict'; var app = angular.module('sysMgrApp'); app.config(['$stateProvider',function($stateProvider) { $stateProvider.state('home', { url: '/', template: '' }). state('edit', { url: '/edit/:id', controller: 'prefsSlsCrudController', templateUrl: 'AccountingAudit/prefsSls/index' }).state('new', { url: '/new', controller: 'prefsSlsCrudController', templateUrl: 'AccountingAudit/prefsSls/index' }); }]); app.controller('prefsSlsSearchController', ['$scope', '$rootScope', '$timeout', '$state', 'prefsSlsService', 'resourceFactory', function ($scope, $rootScope, $timeout, $state, prefsSlsService, resourceFactory) { var init = function () { $scope.isEditLoading = true; $scope.disableAction = false; $scope.showForm = false; doSearch(); }; var doSearch = function (keepForm) { $scope.alertType = ''; $scope.loadingTimeout = $timeout(function () { $scope.results = null; $scope.isSearchLoading = true; }, 250); prefsSlsService.getPrefsSls().then(function (data) { $scope.results = data; $scope.loadView($scope.results); $rootScope.$broadcast('sm:resizeContainer'); $scope.isSearchLoading = false; $timeout.cancel($scope.loadingTimeout); }); }; $scope.loadView = function (prefsSl) { $state.go('edit', { id: prefsSl.priKey }, { reload: true }); $scope.item = { transferTypeOptions: [ { name: resourceFactory.getResource('Labels', 'automaticallyUnprompted'), id: 0 }, { name: resourceFactory.getResource('Labels', 'manuallyPrompted'), id: 1 }], salesTypeOptions: [ { name: resourceFactory.getResource('Labels', 'activationsAndExchanges'), id: 0 }, { name: resourceFactory.getResource('Labels', 'activationsOnly'), id: 1 }, { name: resourceFactory.getResource('Labels', 'exchangesOnly'), id: 2 }], ihcSearchOptions: [ { name: resourceFactory.getResource('Labels', 'guestNumber'), id: 0 }, { name: resourceFactory.getResource('Labels', 'wtpNumber'), id: 1 }], UnassignedItems: prefsSl.unassignedItems, AssignedItems: prefsSl.assignedItems, ihcXfer: prefsSl.ihCxfer, ihcPType: prefsSl.ihCptype, ihcStype: prefsSl.ihCstype, ihcSearch: prefsSl.ihCsearch, priKey: prefsSl.priKey } $scope.showForm = true; $scope.isEditLoading = false; $rootScope.$broadcast('sm:focus'); }; $scope.$on('prefsSls:doSearch', function (event, keepForm) { doSearch(keepForm); }); $scope.cancel = function () { // window.console && console.log("Cancel fired"); $scope.form.$setPristine(); $scope.showForm = false; // close the form }; $scope.$on('sm:hideForm', function (event) { // window.console && console.log("Cancel fired from closing the form") $scope.cancel(); }); $scope.save = function () { $scope.disableAction = true; $scope.alertType = 'saving'; prefsSlsService.savePrefsSl($scope.item).then(function () { $rootScope.$broadcast('prefsSls:doSearch', true); $scope.alertType = 'success'; $scope.alertMessage = resourceFactory.getResource('Messages', 'successfullyUpdated') .format(resourceFactory.getResource('Labels', 'ihcBalanceAssistSettings')); $scope.form.$setPristine(); $scope.disableAction = false; }); }; init(); }]); })();Today I've tried adding reload:"true" for the LoadView function but it didn't help.