foam-framework / foam

Feature-Oriented Active Modeller
Apache License 2.0
787 stars 55 forks source link

Property type: 'some.modelled.Type' doesn't always work #490

Closed adamvy-google closed 8 years ago

adamvy-google commented 8 years ago

Before, when we would define a property as

{ model_: 'some.modelled.TypeProperty', name: 'foo' }

mdoel.FOO would be an instance of some.modelled.TypeProperty as expected.

If we use the type: parameter instead

{ name: 'foo', type: 'some.modelled.Type' }

it doesn't.

This is because JSONUtil will handle the async work to load some.modelled.TypeProperty and create an instance of it, when it encounters the model_: 'some.modelled.TypeProperty' line.