Hi I’m new with ionic.
I use the side menu base template and I want to modify it with a login page that refer to the side menu.
in the default controller.js file I have added $state in the controller parameter and added a function for change the state when call doLogin():
.controller('AppCtrl', function($scope, $ionicModal, $timeout, $state) {
// change state and show the menu
$scope.home = function() {
$state.go('app.menu');
console.log('state, $state.current);
}
// Perform the login action when the user submits the login form
$scope.doLogin = function() {
console.log('Doing login', $scope.loginData);
// Simulate a login delay. Remove this and replace with your login
// code if using a login system
$timeout(function() {
$scope.closeLogin();
}, 1000);
$scope.home
};
In the app.js file I modify the abstract state from menu.html to login.html and add the menu state:
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('app', {
url: "/app",
abstract: true,
templateUrl: "templates/login.html",
controller: 'AppCtrl'
})
.state('app.menu', {
url: "/menu",
templateUrl: "templates/menu.html"
})
menu.html and login templates are the default file from sidemenu tamplate.
Now, I display the login how first page but when click the login button the state don’t change. the page is still the same and in the console there aren’t error.
which probably is the error that I commit?
thanks
Sorry for my english