Hi!! I have been working about this tutorial:
All works fine, but I have a problem with the second time I have visited the “tutorial”. If the user has visited the tutorial, the second time, I have a small transition between the states. The user see how change between the tutorial view and home view.
The code:
angular.module('starter.controllers', [])
.controller('AppCtrl', function($scope, $state) {
$scope.goToTutorialAgain = function()
{
window.localStorage['didTutorial'] = false;
$state.go('app.welcome');
};
})
.controller('HomeCtrl', function($scope) {
})
.controller('WelcomeCtrl', function($scope, $state, $location) {
$scope.finishWelcome = function() {
startApp();
};
// Called to navigate to the main app
var startApp = function() {
$state.go('app.home');
// Set a flag that we finished the tutorial
window.localStorage['didTutorial'] = true;
};
// Check if the user already did the tutorial and skip it if so
if(window.localStorage['didTutorial'] === "true") {
startApp();
return;
}
});
Thanks!!