Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Templated events and observes

$
0
0
Hi all,

Very quick question I think. Is it possible to listen to change events on observes using templated event binding in controls?

Such as:

define(['can', 'core/global/appState'], function(can,  AppState) {
    var AppControl;

    return AppControl = can.Controll({
        init: function(element, options){
           
           
        },

        '{AppState} change': function(ev, attr, how, newVal, oldVal) {
            console.log('appState changed2', ev, attr, how, newVal, oldVal);
        },

   });
});

Where appstate a single Observe that is passed around.

Thanks,

Adam

Viewing all articles
Browse latest Browse all 3491

Trending Articles