hi I am new to this ionic dev I am trying to open the new page on button click.but when I put the alert() it will prompted.
index.html
<div ng-controller="loginCtrl">
<Button id="btnLogin" class="icon icon-right ion-log-in left button button-positive button-block " style="border-radius:15px 15px 15px 15px;" ng-click="login('/login')">Login</Button>
</div>
Routes.js
var app =angular.module(‘app’,[‘ngRoute’]);
app.config(function($stateProvider,$urlRouteProvider){
$stateProvider
.state(‘login’, {
url: ‘/page2’,
templateUrl: ‘templates/login.html’,
controller: ‘loginCtrl’
})
$urlRouteProvider.otherwise(‘/page2’);
});
controller.js
var app =angular.module(‘app’, );
app.controller(‘loginCtrl’, function ($scope, $http,$stateprovider) {
$scope.login = function (path) {
$location.path(path);
alert(path);
};
});
Here I want to open the login.html page while clicking the Login button, but when I click it prompt the alert but I stuck while opening the login page
login.html
<ion-list id="login-list1" class="">
<label class="item item-input " id="login-input1">
<span class="input-label">Username</span>
<input type="text" placeholder="">
</label>
<label class="item item-input " id="login-input2">
<span class="input-label">Password</span>
<input type="password" placeholder="">
</label>
</ion-list>
<div class="spacer" style="height: 40px;"></div>
<a ui-sref="chats" id="login-button3" style="border-radius:15px 15px 15px 15px;" class="button button-calm button-block ">Log in</a>
</ion-content>
I dont Understand what goes wrong with this , I am not able to call the login.hrml page while click login button from index.html