Hey everyone, when creating a dashboard, for a pac...
# package-development
n
Hey everyone, when creating a dashboard, for a package or just a customisation, is there an angular event for anything for when that dashboard is toggled?
a
Seems that only the dashboard panel of the active dashboard/tab is added to the DOM, so I think you should be able to add something in your controller function (when toggled on), and then perhaps listen for the destroy event when toggled off.
Might be a bug, but seems that the controller is fired twice in 10.6.1 when switching back to a dashboard that has been active 😮
n
Interesting, that behaviour might have been around for a while as I feel like I've seen similar in network traffic
a
Can't remember when this was changed. Possibly it was in U8, but not sure
w
@Nik there are some events that Umbraco fire in the codebase. Look for eventService.emit calls these you could then listen for. Potentially may be one that is emitted when dashboard loaded into DOM https://github.com/search?q=repo%3Aumbraco%2FUmbraco-CMS+path%3A%2F%5Esrc%5C%2FUmbraco%5C.Web%5C.UI%5C.Client%5C%2Fsrc%5C%2F%2F+emit&type=code
app.tabChange