{"action":"created","issue":{"url":"https://api.github.com/repos/formly-js/ng-formly/issues/470","repository_url":"https://api.github.com/repos/formly-js/ng-formly","labels_url":"https://api.github.com/repos/formly-js/ng-formly/issues/470/labels{/name}","comments_url":"https://api.github.com/repos/formly-js/ng-formly/issues/470/comments","events_url":"https://api.github.com/repos/formly-js/ng-formly/issues/470/events","html_url":"https://github.com/formly-js/ng-formly/issues/470","id":238755033,"number":470,"title":"repeatSection does not properly show initialized model","user":{"login":"ultimafirez","id":21162369,"avatar_url":"https://avatars0.githubusercontent.com/u/21162369?v=3","gravatar_id":"","url":"https://api.github.com/users/ultimafirez","html_url":"https://github.com/ultimafirez","followers_url":"https://api.github.com/users/ultimafirez/followers","following_url":"https://api.github.com/users/ultimafirez/following{/other_user}","gists_url":"https://api.github.com/users/ultimafirez/gists{/gist_id}","starred_url":"https://api.github.com/users/ultimafirez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ultimafirez/subscriptions","organizations_url":"https://api.github.com/users/ultimafirez/orgs","repos_url":"https://api.github.com/users/ultimafirez/repos","events_url":"https://api.github.com/users/ultimafirez/events{/privacy}","received_events_url":"https://api.github.com/users/ultimafirez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-06-27T07:02:26Z","updated_at":"2017-06-28T17:14:14Z","closed_at":null,"body":"<!--\r\nIF YOU DON'T FILL OUT THE FOLLOWING INFORMATION WE MIGHT CLOSE YOUR ISSUE WITHOUT INVESTIGATING\r\n-->\r\n\r\n**I'm submitting a ...**  (check one with \"x\")\r\n```\r\n[ x] bug report => search github for a similar issue or PR before submitting\r\n[ ] feature request\r\n[ ] support request\r\n```\r\n\r\n**Current behavior**\r\nInitializing the repeat section with a model array of two objects does not properly render the second object in the form. The repeatSection shows two copies of the first object initialized in the model. Additionally, the add button will continue to add copies of the first model.\r\n\r\n**Expected behavior**\r\nIf the repeat section is initialized with the following model:\r\n\r\nthis.user = {\r\n      investments: [\r\n        {\r\n          investmentName: 'Formly',\r\n          investmentDate: '02-11-2001',\r\n          stockIdentifier: 'FO',\r\n        }, {\r\n          investmentName: 'Formly Website',\r\n          investmentDate: '02-11-2001',\r\n          stockIdentifier: 'FW',\r\n        },\r\n      ],\r\n    };\r\n\r\nThe repeat section should show two distinct sections rather than 2 copies of the first section as demonstrated in this plunkr: https://plnkr.co/edit/nAef2k9vrkDxwWsMwQPu?p=preview\r\nFurthermore, pressing the add button will add a copy of the first section.\r\nI have made minimal changes to the plunkr on the demo website to reproduce this issue. I am also seeing this issue in the current release (1.0.0-rc.10)\r\n\r\n\r\n**Minimal reproduction of the problem with instructions**\r\nhttps://plnkr.co/edit/nAef2k9vrkDxwWsMwQPu?p=preview\r\nWhen the repeat section first renders, you will see the described behaviour above. The reset model function also does not work.\r\n\r\n**What is the motivation / use case for changing the behavior?**\r\nNeed a working repeat section that renders each section properly when given a model. As with normal use cases of ng-formly, our backend provides the form data and we need to show this data on the form.\r\n\r\n**Please tell us about your environment:**\r\nIrrelevant.\r\n\r\n* **Angular version:** 2.0.X\r\n2.4.10\r\n\r\n* **Browser:** [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]\r\nall\r\n \r\n* **Language:** [all | TypeScript X.X | ES6/7 | ES5]\r\nTypescript\r\n\r\n* **Node (for AoT issues):** `node --version` =   \r\nIrrelevant"},"comment":{"url":"https://api.github.com/repos/formly-js/ng-formly/issues/comments/311726957","html_url":"https://github.com/formly-js/ng-formly/issues/470#issuecomment-311726957","issue_url":"https://api.github.com/repos/formly-js/ng-formly/issues/470","id":311726957,"user":{"login":"ultimafirez","id":21162369,"avatar_url":"https://avatars0.githubusercontent.com/u/21162369?v=3","gravatar_id":"","url":"https://api.github.com/users/ultimafirez","html_url":"https://github.com/ultimafirez","followers_url":"https://api.github.com/users/ultimafirez/followers","following_url":"https://api.github.com/users/ultimafirez/following{/other_user}","gists_url":"https://api.github.com/users/ultimafirez/gists{/gist_id}","starred_url":"https://api.github.com/users/ultimafirez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ultimafirez/subscriptions","organizations_url":"https://api.github.com/users/ultimafirez/orgs","repos_url":"https://api.github.com/users/ultimafirez/repos","events_url":"https://api.github.com/users/ultimafirez/events{/privacy}","received_events_url":"https://api.github.com/users/ultimafirez/received_events","type":"User","site_admin":false},"created_at":"2017-06-28T17:14:14Z","updated_at":"2017-06-28T17:14:14Z","body":"Thanks @franzeal. I guess the repeatSection I used was from the outdated demo website. Your solution works!"}}
{"actor":{"display_login":"ultimafirez"}}