I am new to Angular and would appreciate your advice. I'm using ui.router
and I configured states like this:
app.config(function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise("/category");
$stateProvider
.state('category', {
url: '/category',
templateUrl: 'category.html',
controller: 'categoryController as catCtrl',
reload: true
})
.state('category.categoryDetail', {
url:'/:id',
templateUrl: 'categoryDetail.html',
controller: 'categoryDetailController as catDetailCtrl',
})
.state('category.categoryDetail.product', {
url:'/product/:prod_id/:filter_model/:current_page',
templateUrl: 'product.html',
controller: 'productController as productCtrl'
})
I need to set timeout function that checks if there is no action for 'n' minutes, then I need the website to return to the default state 'category'
. I know I could do it with jQuery
using setTimeout()
but I'm not sure where to embed the code.