Skip to content

Commit

Permalink
[ES6]Use anonymous function declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehdy Dara committed May 18, 2015
1 parent b02aa68 commit ce427e8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ class MalarkeyDirective {

el.addClass('acme-malarkey');

angular.forEach(scope.extraValues, function(value) {
angular.forEach(scope.extraValues, (value) => {
typist.type(value).pause().delete();
});

watcher = scope.$watch('vm.contributors', function() {
angular.forEach(vm.contributors, function(contributor) {
watcher = scope.$watch('vm.contributors', () => {
angular.forEach(vm.contributors, (contributor) => {
typist.type(contributor.login).pause().delete();
});
});

scope.$on('$destroy', function () {
scope.$on('$destroy', () => {
watcher();
});
}
Expand All @@ -56,13 +56,13 @@ class MalarkeyController {
activate();

function activate() {
return getContributors().then(function() {
return getContributors().then(() => {
$log.info('Activated Contributors View');
});
}

function getContributors() {
return githubContributor.getContributors(10).then(function(data) {
return githubContributor.getContributors(10).then((data) => {
vm.contributors = data;

return vm.contributors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ class WebDevTecService {
constructor () {
'ngInject';

let data = <%= technologies %>;

this.getTec = getTec;
this.data = <%= technologies %>;
}

function getTec() {
return data;
}
getTec() {
return this.data;
}
}

Expand Down
4 changes: 2 additions & 2 deletions app/templates/src/app/main/_main.controller.es6
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class MainController {

function activate() {
getWebDevTec();
$timeout(function() {
$timeout(() => {
vm.classAnimation = 'rubberBand';
}, 4000);
}
Expand All @@ -26,7 +26,7 @@ class MainController {
function getWebDevTec() {
vm.awesomeThings = webDevTec.getTec();

angular.forEach(vm.awesomeThings, function(awesomeThing) {
angular.forEach(vm.awesomeThings, (awesomeThing) => {
awesomeThing.rank = Math.random();
});
}
Expand Down

0 comments on commit ce427e8

Please sign in to comment.