1

I encounter a problem with this code:

console.log('Before define Foo.Bar');

Ext.define('Foo.Bar', {
  requires: [
    'Foo.Some'
  ],
  singleton: true,
  constructor: function () {
    console.log('Foo.Bar constructed');
    console.log(Foo.Some);
  }
});

console.log('Before define Foo.Some');

Ext.define('Foo.Some', {});

In the production build, I get an error when I try to use Foo.Some in the Foo.Bar constructor => "Foo is undefined".

Is there anything I can do?

code4jhon
  • 5,725
  • 9
  • 40
  • 60
Guid
  • 2,137
  • 2
  • 20
  • 33
  • 2
    Are they defined in the same file? They shouldn't be... maybe that's causing the issue. – arthurakay Dec 11 '14 at 21:19
  • 1
    Is `Foo.Some` defined as singelton? You reference it like a singelton, but in the config singleton is missing. – And-y Dec 11 '14 at 21:29

0 Answers0