I recently started developing an IONIC application and encountered a challenge in navigating between pages upon clicking a button. Here is the progress I have made so far:
In my index.html file, I have included various scripts and links for the application setup.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link rel="manifest" href="manifest.json">
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/ionic/js/angular/angular-resource.min.js"></script>
<script src="js/ng-cordova.min.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
<base href="/">
</head>
<body ng-app="starter">
<div ng-controller="MainCtrl">
<ion-content class="bg-img has-bottom">
</ion-content>
<div class="fixed-outside">
<div class="row">
<div class="col">
<button ng-click="login_google()" class="button" id="google-btn">Connect with Google</button>
</div>
</div>
<div class="row">
<div class="col">
<button ng-click="login_fb()" class="button" id="fb-btn">Connect with Facebook</button>
</div>
</div>
<div class="row">
<div class="col">
<button class="button button-stable" ng-click="login()" id="login-btn">Login</button>
</div>
<div class="col">
<button ng-click="register()" class="button button-stable" id="reg-btn">Register</button>
</div>
</div>
</div>
</body>
</html>
Currently, I am focusing on implementing the functionality for the login button to redirect to main.html page.
Furthermore, in the app.js file, I have defined the routing configuration for the application using Angular UI router, but when attempting to navigate to the 'main' state upon clicking the login button, the output on the console shows:
The state is undefined
Despite referring to the documentation, I have not been successful in achieving simple navigation upon button click.