How can I make a template display temporarily for 5 seconds when accessing a specific path with id -The path with id already has its own template-, after 5 seconds the template that should have been shown originally in the route? I searched everywhere and I did not find anything about it. : (
This is an example of how I have the routes:
.config(['$routeProvider', '$locationProvider', function($routeProvider,$locationProvider){
$routeProvider
.when('/',{
redirectTo: '/news'
})
.when('/news',{
templateUrl: 'html/news.html',
controller: 'newsCtrl',
controllerAs: 'news',
title: 'Noticias'
})
.when('/news/:id',{
templateUrl: 'html/article.html',
controller: 'articleCtrl',
controllerAs: 'article',
title: 'Artículo'
})
.otherwise({
redirectTo: '/error404'
});
$locationProvider.html5Mode(true).hashPrefix('!');
}]);
This code makes the template show at a certain time, maybe it could be done with something like that, right?
resolve: {
delay: function($q,$timeout){
var delay = $q.defer();
$timeout(delay.resolve, 250);
return delay.promise;
}
}