Prevent caching computed property of ApplicationController

I tried to implement user name displaying after log in. It displays in top menu. But top menu is getting displayed before log in, so it user name is getting cached.

I tried many approaches, and using volatile() is seems the best option, but it doesn’t work. In this simple example currentTime calculates only once:

<script type="text/x-handlebars" data-template-name="application">
    {{currentTime}}
</script>

App.ApplicationController = Ember.Controller.extend({
  currentTime: function() {
    console.log('computing value');
    var time = new Date();
    return time;
  }.property().volatile()
});

Ember version 1.3

Actually, I can’t find ANY way do display dynamic value in Ember’s application template. Tried to display value from another controller using {{render}} helper, value still gets cached.

The problem is that the template is only requesting the value once. How could it know that the time is changing? It would need to request the value on every frame.

Instead, you can notify Ember that the property has changed, see http://jsbin.com/UPaHOlUJ/1/edit.

At first glance, it doesn’t looks like a right way, but if there is no other working approach, I will use this code. Thanks!

It’s enough to set ApplicationController’s property in a proper way from some other controller.

Working example: http://jsbin.com/OPUSoTaF/4/edit