From 4aed242a48973cbcc62f138c89713336368c0ded Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Fri, 14 Oct 2016 08:19:58 +0200 Subject: [PATCH] Fix angular style issues. --- accountant-ui/js/accounts.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/accountant-ui/js/accounts.js b/accountant-ui/js/accounts.js index 98921b1..7f85851 100644 --- a/accountant-ui/js/accounts.js +++ b/accountant-ui/js/accounts.js @@ -56,8 +56,8 @@ angular.module('accountant.accounts', [ return Account; }) -.controller('AccountController', function($scope, $ngBootbox, Account, Notification) { - var vm=this; +.controller('AccountController', function($ngBootbox, Account, Notification) { + var vm = this; /* * Return the class for an account current value compared to authorized @@ -103,7 +103,7 @@ angular.module('accountant.accounts', [ }); // Insert account at the begining of the array. - $scope.accounts.splice(0, 0, account); + vm.accounts.splice(0, 0, account); }; /* @@ -114,7 +114,7 @@ angular.module('accountant.accounts', [ rowform.$cancel(); } else { // Account not saved, just remove it from array. - $scope.accounts.splice($index, 1); + vm.accounts.splice($index, 1); } }; @@ -122,7 +122,7 @@ angular.module('accountant.accounts', [ * Save account. */ vm.save = function(account) { - // var account = $scope.accounts[$index]; + // var account = vm.accounts[$index]; // account = angular.merge(account, $data); @@ -149,7 +149,7 @@ angular.module('accountant.accounts', [ Notification.success('Account #' + id + ' deleted.'); // Remove account from array. - $scope.accounts.splice($index, 1); + vm.accounts.splice($index, 1); }); } }