'use strict';

(function() {
  var app = angular.module('bifrost');

  app.controller('ProjectsController', function($scope, Supporter, Project) {
    $scope.userLoaded = false;
    Supporter.getCurrent().$promise.then(function(user) {
      $scope.userLoaded = true;
      $scope.user = user;
    }).catch(function() {
      $scope.userLoaded = true;
    });

    Project.find({include: ['supporter']}).$promise.then(function(projects) {
      $scope.projects = projects;
      $scope.$emit('projects', projects);
    });
  })
  .controller('MyProjectsController',
  function($scope, $state, $mdSidenav, async, Supporter, Project) {
    async.series([
      function(callback) {
        Supporter.getCurrent().$promise.then(function(user) {
          $scope.user = user;
          callback();
        });
      },
      function(callback) {
        Supporter.projects({id: $scope.user.id})
        .$promise.then(function(projects) {
          $scope.projects = projects;
          callback();
        });
      }
    ]);

    $scope.toggleRight = function() {
      $mdSidenav('right')
      .toggle()
      .then(function(){});
    };

    $scope.logout = function() {
      Supporter.logout().$promise.then(function() {
        $state.go('login');
      });
    };
  });

})();

@@ -13,26 +13,21 @@
 ;%0A%0A(
-function()
+() =%3E
  %7B%0A  
-var
+let
  app
@@ -96,24 +96,16 @@
 oller', 
-function
 ($scope,
@@ -120,24 +120,27 @@
 er, Project)
+ =%3E
  %7B%0A    $scop
@@ -290,34 +290,21 @@
 ).catch(
-function() %7B%0A     
+() =%3E
  $scope.
@@ -320,23 +320,16 @@
 d = true
-;%0A    %7D
 );%0A%0A    
@@ -381,33 +381,24 @@
 se.then(
-function(
 projects
 ) %7B%0A    
@@ -381,33 +381,35 @@
 se.then(projects
-)
+ =%3E
  %7B%0A      $scope.
@@ -483,19 +483,24 @@
 %7D);%0A  %7D)
+;%0A
 %0A  
+app
 .control
@@ -529,24 +529,16 @@
 ler',%0A  
-function
 ($scope,
@@ -584,16 +584,19 @@
 Project)
+ =%3E
  %7B%0A    a
@@ -615,33 +615,24 @@
 %5B%0A      
-function(
 callback
 ) %7B%0A    
@@ -615,33 +615,35 @@
 %5B%0A      callback
-)
+ =%3E
  %7B%0A        Suppo
@@ -670,38 +670,31 @@
 romise.then(
-function(
 user
-)
+ =%3E
  %7B%0A         
@@ -767,25 +767,16 @@
     
-function(
 callback
 ) %7B%0A
@@ -771,17 +771,19 @@
 callback
-)
+ =%3E
  %7B%0A     
@@ -825,25 +825,16 @@
 ser.id%7D)
-%0A        
 .$promis
@@ -844,25 +844,16 @@
 hen(
-function(
 projects
 ) %7B%0A
@@ -848,17 +848,19 @@
 projects
-)
+ =%3E
  %7B%0A     
@@ -964,34 +964,29 @@
 ggleRight = 
-function()
+() =%3E
  %7B%0A      $md
@@ -1021,34 +1021,8 @@
 le()
-%0A      .then(function()%7B%7D)
 ;%0A  
@@ -1047,26 +1047,21 @@
 ogout = 
-function()
+() =%3E
  %7B%0A     
@@ -1098,28 +1098,13 @@
 hen(
-function() %7B%0A       
+() =%3E
  $st
@@ -1118,25 +1118,16 @@
 'login')
-;%0A      %7D
 );%0A    %7D

Use es6 for projects.js