Here is the HTML code I am working with:
<a ui-sref="videoParent.Display.video({videoName:'[[sVid.slug]]', videoId:'[[sVid.videoID]]'})"><p>[[sVid.name]]</p></a>
The parameters videoName and videoId are retrieved in the JavaScript file like this:
.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;
}
}]
}
},
When my URL is generated, it looks like this:
../video/data-statistician/5
However, I want to hide the videoId (5) and have the output as:
../video/data-statistician
I can achieve this by changing the url part of my state to:
url: "/video/:videoName
But the issue is that if I do that, the videoId will not be included in the $stateparams object.
Is there a way for me to pass the video ID to the state without showing it in the URL?