Execute script after dashboard loads

(Karan Sharma) #1

I have some code in hack.js which needs to be executed ONLY AFTER the dashboard had loaded, is there any event emitted when a dashboard finishes loading?

Some more detail:
I need to access dashboard name using $route.current.locals, hack.js executes before dashboad load and $route.current.locals is a null value, any way to avoid this?

(Brandon Kobel) #2

Hey @Karan_Sharma we aren't emitting any events when the Dashboard saved object loads and is added to the $route.current/locals. What is it that you're trying to accomplish in your hack.js? Perhaps there is another way to accomplish your objective.

You could potentially poll periodically until that value that you need is there, but that's rather "hackish".

(Karan Sharma) #3

Thanks, i actually ended up using $scope.$watch. It worked :slight_smile:

(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.