Getting $timeout to work all the time in my App


#1

I have the following code on my playlist which works great when the page is loaded, but not afterwards when browsing across the app. I spotted the $ionicView.enter at the top of the controller and assume this is what I need to add.

How do I incorporate the $ionicView.enter into this controller code?

.controller(‘PlaylistsCtrl’, function($scope, $state, $timeout) {
$scope.playlists = [
{ title: ‘Video 1’, id: 1, video: ‘video/vid1.mp4’ },
{ title: ‘Video 2’, id: 2, video: ‘video/vid2.mp4’ },
];

$timeout(function() {
$state.go(‘app.home’);
}, 10000);
})