diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-15 12:26:42 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-15 12:26:42 +0200 |
commit | d6625bc44524500e11c9072c6ba294112cd52d43 (patch) | |
tree | cd1e93b6b21434d6aba7725821d811d312d687f7 /js/config/run.js | |
parent | 866f17fe43f841691a8858d671962d623369d3b3 (diff) |
fix protractor tests
Diffstat (limited to 'js/config/run.js')
-rw-r--r-- | js/config/run.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/js/config/run.js b/js/config/run.js index 3feca64e4..1c87228fe 100644 --- a/js/config/run.js +++ b/js/config/run.js @@ -7,8 +7,19 @@ * @author Bernhard Posselt <dev@bernhard-posselt.com> * @copyright Bernhard Posselt 2012, 2014 */ -app.run(function ($rootScope) { +app.run(function ($rootScope, $location, Loading) { 'use strict'; - $rootScope.$on('$routeChangeError'); + $rootScope.$on('$routeChangeStart', function () { + Loading.isActive = true; + }); + + $rootScope.$on('$routeChangeSuccess', function () { + Loading.isActive = false; + }); + + // in case of wrong id etc show all items + $rootScope.$on('$routeChangeError', function () { + $location.path('/items'); + }); });
\ No newline at end of file |