My HTML is as follows:
<a ui-sref="videoParent.Display.video({videoName:'[[sVid.slug]]', videoId:'[[sVid.videoID]]'})"><p>[[sVid.name]]</p></a>
I then retrieve the parameters videoName and videoId in my js file as follows
.state("videoParent.Display.video", {
url: "/video/:videoName/:videoId",
views: {
'video_info@videoParent': {
templateUrl: "/partials/starred_video.html",
controller: "starredVideoController",
controllerAs: "starredVidsCtrl",
resolve: {
retrivedVideo: ['videosService', '$stateParams', function(videosService, $stateParams) {
if ($stateParams.videoId) {
var video = videosService.getVideoById($stateParams.videoId);
return video;
}
}]
}
},
In my url I get a result like this:
../video/data-statistician/5
However, I do not wish to show the videoId (5) and would rather have my output as:
../video/data-statistician
I can achieve the desired result by writing the url part of my state as:
url: "/video/:videoName
but the problem is that if I write my code as above, the videoId will not be included in the $stateparams object.
How can I pass the video ID to the state without showing in the URL?