We have functionality where in we have make reservation editable,when user clicks on link from email.
Currently user can browse in the website and lookup based on the email address and then click on edit to make changes to reservation,so the edit functionality is like a child only action.
<button ng-if="!reservation.editing" test-id="reservations-reservation-edit-button" ng-click="edit(reservation)" class="btn btn-link change-link details-edit-reservation-link">Edit</button>
The email link will have parameters like "RId","UserId" ...
The question is how can we invoke the edit action directly, based on the parameter passed. Below is the snippet of current $state.go
sp.state('reservations', {
url: '/reservations?e&getDetail&edit',
templateUrl: 'src/reservations/template.html',
data: {
backState: "back",
shortTitle: "Reservations"
}
Can we make any changes in $state, so that we can do conditional routing and then invoke the edit and edit functionality function snippet looks like this
$scope.edit = function(reservation){
scrollToTop(true);
.....}