i have try lots of method to redirect page but its not working for me can any one have this solution
below is my code
controller.js
.controller(‘TestCtrl’,function($scope,$state) {
$scope.register = function($scope,$state, $location) {
alert('function called');
// console.log("Button was pressed!");
// $location.transitionTo('/app.search');
$scope.state.go('app.search');
// $location.path("/app/search");
// $state.go("search");
// $location.path('/app.search');
// $scope.changeRoute('#/app/search');
// $window.location.href = '/app/search';
}
})
registration.html
<form >
<div class="list">
<label class="item item-input ">
<input type="text" placeholder="FIRST NAME">
</label>
<label class="item item-input">
<input type="text" placeholder="LAST NAME">
</label>
<label class="item item-input item-select">
<div class="input-label">
COUNTRY
</div>
<select >
<option selected>Algeria</option>
<option >Bangladesh</option>
<option >Belgium</option>
<option >China</option>
<option >France</option>
<option >India</option>
<option >Japan</option>
<option >North Korea</option>
<option>USA</option>
</select>
</label>
<label class="item item-input ">
<input type="text" placeholder="EMAIL">
</label>
<label class="item item-input ">
<ion-radio ng-model="choice" ng-value="'A'">MALE</ion-radio>
<ion-radio ng-model="choice" ng-value="'B'">FEMALE</ion-radio>
</label>
<label class="item item-input">
<input type="password" placeholder="PASSWORD">
</label>
<label class="item item-input">
<input type="password" placeholder="RETYPE PASSWORD">
</label>
<label class="item">
<button class="button button-block button-positive" type="submit" ng-click="register()">Register</button>
</label>
</div>
</form>
app.js
.state(‘app.search’, {
url: ‘/search’,
views: {
‘menuContent’: {
templateUrl: ‘templates/search.html’
}
}
})
.state(‘app.registration’, {
url: ‘/registration’,
views: {
‘menuContent’: {
templateUrl: ‘templates/registration.html’,
controller:‘TestCtrl’
}
}
})