-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular Material ArrayLayoutRenderer: Cannot read property 'scope' of undefined #1781
Comments
Hi @JBBianchi, thanks for the bug report. Arrays of objects are definitely supported. I can reproduce the issue in the seed. It seems something goes wrong when we build the JSON Forms Angular packages as our internal example application in the JSON Forms repository can render your schemas without a problem. We'll definitely take a look at this. Unrelated to the problem: When you want to define a ui schema for the array children then it must be placed in the {
"type": "VerticalLayout",
"elements": [
{
"type": "Control",
"scope": "#/properties/some-object",
"options": {
"detail": {
"type": "VerticalLayout",
"elements": [
{
"type": "Control",
"scope": "#/properties/some-prop"
}
]
}
}
}
]
} |
I think it's because |
The JsonFormsAbstractControl was not exported by the angular package. This lead to duplicate instances of the angular package when using the ArrayLayoutRenderer and thus to the ArrayLayoutRenderer not working. By not using a deep import in the ArrayLayoutRenderer only one instance of the angular package exists. Fix eclipsesource#1781
The JsonFormsAbstractControl was not exported by the angular package. This lead to duplicate instances of the angular package when using the ArrayLayoutRenderer and thus to the ArrayLayoutRenderer not working. By not using a deep import in the ArrayLayoutRenderer only one instance of the angular package exists. Fix #1781
Version |
Describe the bug
An array of objects cannot be rendered even though it's marked as supported in the renderer set.
Expected behavior
The array of objects to be rendered, to be able to add and remove items.
Steps to reproduce the issue
schema.json
asset to the following:ui-schema.json
asset to the following:npm start
and visithttp://localhost:4200/
Screenshots
No response
In which browser are you experiencing the issue?
Chrome 91.0.4472.124 x64
Framework
Angular
RendererSet
Material
Additional context
Angular CLI: 11.2.11
Node: 12.22.1
OS: win32 x64
Angular: 11.2.12
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes
Package Version
@angular-devkit/architect 0.1102.11
@angular-devkit/build-angular 0.1102.11
@angular-devkit/core 11.2.11
@angular-devkit/schematics 11.2.11
@angular/cdk 11.2.11
@angular/cli 11.2.11
@angular/flex-layout 11.0.0-beta.33
@angular/material 11.2.11
@schematics/angular 11.2.11
@schematics/update 0.1102.11
rxjs 6.6.3
typescript 4.1.5
@jsonforms/angular 2.5.1
@jsonforms/angular-material 2.5.1
@jsonforms/core 2.5.1
The text was updated successfully, but these errors were encountered: