Robot
Robot

Reputation: 1065

extjs4 - How to call an application function from a controller?

Given an application:

Ext.application({
    name: 'APP',
    appFolder: 'app',

    funcA: function() {
        console.log('called funcA');
    },

    launch: function() {
        ...
        var funcB = function() {
            console.log('called funcB');
        }
        ...
    }
});

My controller can call this.application.funcA() but not funcB() within the launch method. How can I call funcB() externally?

Upvotes: 3

Views: 1309

Answers (1)

Matt Greer
Matt Greer

Reputation: 62027

You can't, as funcB is private to your launch callback, You can move it outside of the callback, just like you did funcA. Basically anything defined inside of a function is private to that function.

Upvotes: 5

Related Questions