Refresh HTML panel on auto-refresh

Within my dashboard I have a HTML panel, which I want to auto refresh every time the dashboard refreshes. In release 5.3.4, I achieved this with the following code:

   <div id="myTextPanel" class="ng-scope">
     <script type="text/javascript">
       function refreshMyPanel() {
       $(document).ready(function() {
         refreshMyPanel(); // For the initial load of data
         // Refetch data every time the "refresh" event is broadcast
         angular.element('#myTextPanel').injector().get('$rootScope').$on('refresh', function() {refreshMyPanel();});
       <p id="TableHolder"></p>

However, since release 5.4 this is no longer working. What has happened in the new release that this is no longer working or is there an alternative solution?

Any updates or solutions for this yet? I’m facing the same problem!