Reputation: 7724
http://plnkr.co/edit/D89QGLbKWbqp6T7Igfhy
the above plnkr have my same project of what i have done to navigate to another page on clicking a button(login) i should go to view.html page i am not sure where i am strugling please let me know if you find my error
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('login', {
url: '/login',
templateUrl: 'templates/view.html',
});
$urlRouterProvider.otherwise('view.html');
});
this what my .config file look like
Upvotes: 0
Views: 2359
Reputation: 677
In this plnkr you can see ng-click
directive in the button that call a function in Login
controller. This function calls $state.go("login")
that will redirect to view.html
.
Upvotes: 1
Reputation: 217
Try This
.state('login', {
url: '/login',
title: 'UnPublished',
templateUrl: helper.basepath('templates/view.html'),
resolve: helper.resolveFor('ui-router')
})
Upvotes: 0
Reputation: 180
You need to map your button with the wanted state:
<a ui-sref="login">
<button class="button button-block button-positive">
login
</button>
</a>
http://plnkr.co/edit/J9MmnPac2GXgqL522oHe
Upvotes: 0