angularjs - When the URL changes and the controller is the same, don't reload the view -
i have list of videos, , when user clicks 1 of them, don't want view open. instead want selected video open in overlay on other videos. when overlay video closed, list of videos under reveal again, without need load or request once more.
the overlay done simply, such:
<div class="overlay" ng-show="watching">
where watching
variable video selected playing. in order stop watching video, set watching
variable null
close overlay.
the problem cannot solve here, when click watch video, url has change, because want users able share it. doing so, view reloaded, , animation animated view plays again. bad.
i expecting reloadonsearch
parameter solve problem, doesn't seem change in regard. declaration of both videos list url, , watch url in config, hoping solve making watch url optional:
.when("/videos/:action?/:videoid?", { controller: "videoscontroller", templateurl: "tpl/partials/videos.html", reloadonsearch: false })
the url list of videos /videos
, , url watching specific video /videos/watch/id
.
so want able manually change url /videos
/videos/watch/id
, , vice-versa, without angular executing anything, controllers, , loading views. @ same time, obviously, if change other url rest of page, such /contact
, needs continue normal work executing appropriate controller page.
Comments
Post a Comment