I have set up my routes using ui-router in the following way:
$stateProvider
.state('root', {
url: "",
templateUrl: 'path/login.html',
controller: 'LoginController'
})
.state('basket', {
url: "/basket",
views: {
'': {
templateUrl: 'path/basket.html',
controller: 'BasketController'
},
'address@basket': {
templateUrl: 'path/address.html',
controller: 'AddressController'
},
'confirmation@basket': {
templateUrl: 'path/confirmation.html',
controller: 'ConfirmationController'
},
'payment@basket': {
templateUrl: 'path/payment.html',
controller: 'PaymentController'
}
}
});
In the basket.html
file, I am using mgo-angular-wizard
to create a "step bar".
<wizard on-finish="finishedWizard()">
<wz-step title="Address">
<div ui-view="address"></div>
</wz-step>
<wz-step title="Confirmation">
<div ui-view="confirmation"></div>
</wz-step>
<wz-step title="Payment">
<div ui-view="payment"></div>
</wz-step>
Everything is working as expected so far. However, I now need to add buttons that will allow navigation between these pages. For instance, the Address page should have a button that navigates to the Confirmation page. I have seen examples online using
ui-sref="$state.go('basket.address')"
, but since I'm not using this structure with dots, I am unsure how to achieve this (using confirmation@basket
is not working).
I am relatively new to Angular and learning as I go. Thank you in advance.