Skip to content

Array showing only first item (but not in the playground) #256

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

Open
SimoneMSR opened this issue Apr 5, 2018 · 0 comments
Open

Array showing only first item (but not in the playground) #256

SimoneMSR opened this issue Apr 5, 2018 · 0 comments

Comments

@SimoneMSR
Copy link

Issue type

I'm submitting a (check one):
[x] Bug report

Prerequisites

Before posting, make sure you do the following (check all):
[x] Confirm you are using the latest versions of all necessary packages (or if not, explain why not)
[x] Search GitHub for a similar issue or PR
[x] If submitting a Support request, also search [Stack Overflow][stack-overflow] for similar issues
Note: Please cross-post GitHub support requests to [Stack Overflow][stack-overflow], and include a link in your GitHub issue to your Stack Overflow question. We do currently respond to support requests on GitHub, but we eventually expect to stop, and will then refer all support questions exclusively to Stack Overflow.

Current behavior

When having a json object with one property being an array,

  1. only the first item is showed. Differently from issue array showing only first item #195 , no console errors are showed. Moreover,
  2. after the view is rendered, the ngModel 'data' property is changed so that the array (now) has just one element!

If using the same data, schema and form settings in the playground, everything works.

Expected behavior

When having a json object with one property being an array,

  1. all array items should be visible
  2. the ngModel array property should not be updated to an array of length 1!

IMPORTANT: How can we reproduce your problem?

schema:

{
    'type': 'object',
    'properties': {
      'brokers': { 
        'type': 'array',
        'items' : {
          'type' : 'object',
          'properties' : {
            "broker": { 'type': 'string' }
          }
        }
       }
    }
  };

form

[
    {
      type: "tabs",
      tabs: [
      {
         title: "Brokers",
          type: "array",
          startEmpty: false,
          items : [
            "brokers[].broker"
          ]
        }
      ]
    }
  ];
{
"brokers": [
    {
      "broker": "Coincheck",
    },
    {
      "broker": "Bitflyer",
    }
  ]
}

Environment

OS name & version: Windows 10
Browser name & version: Chrome 65.0.3325.181 (official Build) (64 bit)
Angular version: 5.2.4
Angular JSON Schema Form version(s): 0.7.0-alpha.1
Other relevant software or packages:
Angular/flex-layout : 2.0.0-beta.12
boostrap : 4.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant