Open adamvy-google opened 8 years ago
The follow example demonstrates:
foam.CLASS({
name: 'Abc',
properties: [ 'a' ]
});
foam.CLASS({
name: 'Def',
properties: [ 'b' ]
});
foam.u2.DetailView.create({
data: Abc.create({
a: Def.create({
b: 'hello'
})
})
}).write();
If you run this code you get the following error: "Assertion Failed: Attribute value must be a primitive type."
But this error does not really make clear what you did wrong. It's not obvious to a new user that an untyped property tries to render as a text field, and therefore will fail if set to an object.
That means you don't get reasonable default behaviour with an untyped property set to an object.
We should maybe set the view of an untyped property to something that only renders a text field if primitive and renders a read only label, or a detail view if set to an object.