Application.Controllers.controller("projectSideboard",
    ["$scope", "ui", "sideboard",
        projectSideboard]);
function projectSideboard($scope, ui, sideboard) {
    var result = [];
    if ($scope.empty) {
        result = sideboard.get($scope.project.id);
        $scope.sideboard = result.emptySideBoard;
    } else {
        result = sideboard.get($scope.project.id);
        $scope.sideboard = result.sideboard;
    }

    $scope.toggleExpanded = function() {
        ui.toggleIsExpanded($scope.project.id, "sideboard");
    };

    $scope.isExpanded = function() {
        return ui.isExpanded($scope.project.id, "sideboard");
    };

    $scope.minimize = function() {
        ui.togglePanelState($scope.project.id, 'sideboard');
    };

    $scope.splitScreen = function (what, col) {
        //ui.toggleColumns($scope.project.id, what, col);
        //ui.toggleIsExpanded($scope.project.id, "sideboard");

        ui.togglesideboards($scope.project.id);
        ui.toggleIsExpanded($scope.project.id, "sideboard");

    };

    $scope.isSplitExpanded = function () {
        return ui.getSplitStatus($scope.project.id);
    };

    $scope.onDrop = function (ignore, item, event) {
        if ($scope.empty) {
            sideboard.handleFromEvent($scope.project.id, item, event, 'emptySideBoard');
        } else {
            var i = _.indexOf($scope.sideboard, function (f) {
                return f.id === item.id;
            });
            // If item is already in list then don't add it again.
            if (i === -1) {
                sideboard.handleFromEvent($scope.project.id, item, event, 'sideboard');
            }
        }
    };
}

@@ -1,121 +1,153 @@
-Application.Controllers.controller(%22projectSideboard%22,%0A    %5B%22$scope%22, %22ui%22, %22sideboard%22,%0A        projectSideboard%5D);%0A
+(function (module) %7B%0A    module.controller(%22projectSideboard%22, projectSideboard);%0A    projectSideboard.$inject = %5B%22$scope%22, %22ui%22, %22sideboard%22%5D;%0A%0A    
 func
@@ -189,24 +189,28 @@
 ideboard) %7B%0A
+    
     var resu
@@ -218,24 +218,28 @@
 t = %5B%5D;%0A    
+  
+  
 if ($scope.e
@@ -246,32 +246,36 @@
 mpty) %7B%0A        
+   
+ 
 result = sideboa
@@ -301,32 +301,36 @@
 ct.id);%0A        
+    
 $scope.sideboard
@@ -355,24 +355,28 @@
 eBoard;%0A    
+  
+  
 %7D else %7B%0A   
@@ -364,32 +364,36 @@
        %7D else %7B%0A
+    
         result =
@@ -427,32 +427,36 @@
 ct.id);%0A        
+    
 $scope.sideboard
@@ -484,11 +484,19 @@
     
+   
+ 
 %7D%0A%0A
+    
     
@@ -519,32 +519,33 @@
 anded = function
+ 
 () %7B%0A        ui.
@@ -533,32 +533,36 @@
 on () %7B%0A        
+ 
+   
 ui.toggleIsExpan
@@ -594,36 +594,44 @@
 ideboard%22);%0A    
-%7D;%0A%0A
+    %7D;%0A%0A    
     $scope.isExp
@@ -638,32 +638,33 @@
 anded = function
+ 
 () %7B%0A        ret
@@ -652,32 +652,36 @@
 on () %7B%0A        
+ 
+   
 return ui.isExpa
@@ -718,28 +718,36 @@
 oard%22);%0A    
-%7D;%0A%0A
+    %7D;%0A%0A    
     $scope.m
@@ -764,16 +764,17 @@
 function
+ 
 () %7B%0A   
@@ -770,32 +770,36 @@
 on () %7B%0A        
+  
+  
 ui.togglePanelSt
@@ -835,28 +835,36 @@
 oard');%0A    
-%7D;%0A%0A
+    %7D;%0A%0A    
     $scope.s
@@ -890,25 +890,16 @@
 on (
-what, col
 ) %7B%0A    
     
@@ -898,126 +898,8 @@
     
-    //ui.toggleColumns($scope.project.id, what, col);%0A        //ui.toggleIsExpanded($scope.project.id, %22sideboard%22);%0A%0A
     
@@ -934,32 +934,36 @@
 pe.project.id);%0A
+    
         ui.toggl
@@ -1008,16 +1008,20 @@
 ard%22);%0A%0A
+    
     %7D;%0A%0A
@@ -1020,24 +1020,28 @@
     %7D;%0A%0A    
+ 
+   
 $scope.isSpl
@@ -1059,32 +1059,36 @@
 = function () %7B%0A
+    
         return u
@@ -1120,24 +1120,28 @@
 roject.id);%0A
+    
     %7D;%0A%0A    
@@ -1136,24 +1136,28 @@
     %7D;%0A%0A    
+   
+ 
 $scope.onDro
@@ -1193,32 +1193,36 @@
 vent) %7B%0A        
+    
 if ($scope.empty
@@ -1229,32 +1229,36 @@
 ) %7B%0A            
+  
+  
 sideboard.handle
@@ -1310,32 +1310,36 @@
 ptySideBoard');%0A
+    
         %7D else %7B
@@ -1347,24 +1347,28 @@
             
+    
 var i = _.in
@@ -1418,24 +1418,28 @@
             
+    
 return f.id 
@@ -1463,16 +1463,20 @@
         
+    
 %7D);%0A    
@@ -1483,16 +1483,20 @@
         
+  
+  
 // If it
@@ -1550,24 +1550,28 @@
             
+    
 if (i === -1
@@ -1582,32 +1582,36 @@
                 
+ 
+   
 sideboard.handle
@@ -1674,26 +1674,34 @@
             
+   
+ 
 %7D%0A
+    
         %7D%0A  
@@ -1706,9 +1706,57 @@
     
+  
+  
 %7D;%0A
-%7D
+    %7D%0A%7D(angular.module('materialscommons')));
 %0A

Switch to IIFE