From 367f4bc99265d943342d463a4121145056e5f1d1 Mon Sep 17 00:00:00 2001 From: scanniza Date: Sun, 23 Nov 2014 17:29:39 +0100 Subject: [PATCH] end screen --- app/controllers/controllers.js | 5 ++++- app/partials/end.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/controllers.js b/app/controllers/controllers.js index 8e42301..b77894a 100644 --- a/app/controllers/controllers.js +++ b/app/controllers/controllers.js @@ -1,7 +1,7 @@ var app = angular.module('janu'); -app.controller('januController', ['$scope','$http','$interval', function ($scope,$http,$interval){ +app.controller('januController', ['$scope','$http','$interval','$location', function ($scope,$http,$interval,$location){ var janu = $scope; @@ -212,6 +212,9 @@ app.controller('januController', ['$scope','$http','$interval', function ($scope $('#album-cover').removeClass('correct'); $('#album-cover').removeClass('wrong'); $("#song-details").hide(); + if($scope.timelineSongs.length===10){ + $location.path('/end?'+$scope.score.total;); + } newSong = fetchNewSong(); playSong(newSong); $scope.markerSet = false; diff --git a/app/partials/end.html b/app/partials/end.html index 2ebdeab..33e1ceb 100644 --- a/app/partials/end.html +++ b/app/partials/end.html @@ -1 +1 @@ -

Game over

\ No newline at end of file +

Game over