I have a list of hotels and I am passing a URL friendly slug for the hotel in the parameter in the URL hotel/nice-hotel.
This is ok and fine.
I want to also pass the hotel ID to the next page but don't want pass it in the URL. What is the best way of doing this?
.state('hotels', {
title: 'Hotels page',
url: '/hotels',
controller: 'HotelsController',
templateUrl: 'app/components/hotels/hotelsView.html'
})
.state('hotel', {
title: 'Hotel page',
url: '/hotel/:hotelName',
controller: 'HotelController',
templateUrl: 'app/components/hotel/hotelView.html'
params:{hotelId:hotelId};
})
The link I'm passing
<a type="button" ui-sref="hotel({hotelId:{{hotel.hotelId}},hotelName:{hotel.hotelName}})" href="/hotel/{{hotel.name | slugify}}" class="ach-hl-btn btn btn-warning">Select</a>