New plugin front-end helper function: navigateByUrl #6451
Labels
Component: PeerTube Plugin 📦
Features that can be developed in a plugin, but require PeerTube plugin API development
Type: Feature Request ✨
Describe the problem to be solved
If a plugin wants to navigate to another page (for example after having saved something), and uses
<a>
tag or something likewindow.location.href = '/p/xxxx'
, currently the page will reload (despite Peertube is a one-page app).The correct way to navigate using Angular is something like
router.navigateByUrl('/p/xxx')
, but plugins don't have access to angular router and angular methods.Describe the solution you would like
Front-end helpers should include a method to navigate to angular routes. Something like
peertubeHelpers.navigateByUrl(url)
which could be bind to the associated angular method.The text was updated successfully, but these errors were encountered: