Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49186

How to prevent navigating by IF?

$
0
0

@ruslan_z wrote:

app.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('home', {
url: '/home',
templateUrl: 'templates/home.html'
})
.state('index', {
url: '/login',
templateUrl: 'templates/login.html',
})
$urlRouterProvider.otherwise('/login');
})
app.controller('Login', function($scope, $rootScope, $state) {
$scope.input = {
login: '',
pass: ''
}
$scope.getUser = function(input) {
if($scope.input.pass.length > 3) {
console.log("Verificated!");
} else {
console.log('Wrong pass!');
};
};
});

https://embed.plnkr.co/7xFjPgU9zUXaDJO7Lc4B/

How to prevent navigating if some_condition?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49186

Trending Articles