/*
Data Structure for Side Nav

Sidenavs come in 1 form: 'Navbar'

Example 1: Navbar

data = {
  style: 'Navbar',
  breadcrumb:{
    state: 'devtools.index',
    title: 'Dev Tools',
    previousState: 'application.state',
    previousStateTitle: 'My App'
  },
  sections:[
    {
      title: 'Application',
      state: 'dashboard.organization.index({orgId: session.organization.id})',
      icon: 'ion-monitor'
    },{
      title: 'Settings',
      state: 'dashboard.organization.index({orgId: session.organization.id})',
      icon: 'ion-settings',
      hide: '!session.currentUser().admin'
    },{
      title: 'FAQ',
      href: 'http://faq.redoxengine.com',
      icon: 'ion-help-circled'
    }
  ]
}

 For Table of Contents style navbars, (As used in Redox Docs/DataModels) Holding off for now - waiting for additional use cases.

*/

var app = angular.module('ruiComponents');


app.directive('ruiSidenav', ['$compile', function ($compile) {
	return {
		restrict: 'AE',
		scope: {
      data: '='
    },
    link: function(scope, element, attrs, ctrl, linker){

      scope.sidenavData = scope.data;
			for (i = 0 ;i < scope.sidenavData.sections.length; i++){
				if (scope.sidenavData.sections[i].state){
					scope.sidenavData.sections[i].statename = scope.sidenavData.sections[i].state.toString().split("(")[0];
				}
			}
			console.log(scope)
			element.append('<div ng-include="\'templates/sidenav.html\'"></div>');
			$compile(element.contents())(scope);
    }
	};
}]);

@@ -944,17 +944,18 @@
 pile) %7B%0A
-%09
+  
 return %7B
@@ -955,18 +955,20 @@
 eturn %7B%0A
-%09%09
+    
 restrict
@@ -975,18 +975,20 @@
 : 'AE',%0A
-%09%09
+    
 scope: %7B
@@ -1107,19 +1107,22 @@
 e.data;%0A
-%09%09%09
+      
 for (i =
@@ -1170,20 +1170,24 @@
 ; i++)%7B%0A
-%09%09%09%09
+        
 if (scop
@@ -1224,13 +1224,18 @@
 e)%7B%0A
-%09%09%09%09%09
+          
 scop
@@ -1338,22 +1338,32 @@
 0%5D;%0A
-%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09
+        %7D%0A      %7D%0A      
 cons
@@ -1377,19 +1377,22 @@
 (scope)%0A
-%09%09%09
+      
 element.
@@ -1458,11 +1458,14 @@
 ');%0A
-%09%09%09
+      
 $com
@@ -1507,9 +1507,10 @@
   %7D%0A
-%09
+  
 %7D;%0A%7D

untabify all