[Announce] Dashboard version 2.10.0

@TotallyInformation: It indeed works fine, as long as I keep the code in the template node. But as soon as I use it in my own UI contribution, nothing ... But thanks for spending your time on this one!

@nisiyama: If have tried your new version of beforeEmit, and that seems to do the job!

Did a simple test by injecting msg.payload = "Hello world" or "Hello mars" into my UI node like this:

image

When I use now the following code snippet:

initController: function($scope, events) {
    $scope.$watch('msg', function(newVal, oldVal) {
        console.log('Watch is called ...');
        console.dir(newVal);
        console.dir(oldVal);
        console.dir($scope.msg);
    })
}

Then the stuff below is being logged in my Chrome console:

  1. When dashboard is loaded in new tabpage, all 3 variables are undefined.
  2. When a message (with msg.payload = "Hello world") is injected, the newVal contains the new message and the oldVal is undefined.
  3. When a message (with msg.payload = "Hello mars") is injected, the newVal contains the new message and the oldVal contains the old message.
  4. When the page is refreshed, newValue contains the last message and oldValue is undefined.

So $scope.msg is always equal to newVal (as expected), so we don't need the $scope.msg here anymore.
And the on-load situation (1) can be ignored with a simple IF statement:

initController: function($scope, events) {
    $scope.$watch('msg', function(newVal, oldVal) {
        if (!newVal) {
            return;
        }

        console.dir(newVal);
    })
}

But I hadn't expected that the refresh situation (4) would trigger the watch with an older message. Or is that normal behaviour to start again where we left before the refresh?

It would be useful for other users to add your information to the above wiki page, and perhaps integrate it somehow in the 'reference' ui-list example node ...

Thank you very much!!!
Bart