{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/10165","labels_url":"https://api.github.com/repos/angular/angular.js/issues/10165/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/10165/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/10165/events","html_url":"https://github.com/angular/angular.js/issues/10165","id":49757469,"number":10165,"title":"Form control is overridden when nesting with ng-form and ng-repeat","user":{"login":"hanneskaeufler","id":68024,"avatar_url":"https://avatars.githubusercontent.com/u/68024?v=3","gravatar_id":"","url":"https://api.github.com/users/hanneskaeufler","html_url":"https://github.com/hanneskaeufler","followers_url":"https://api.github.com/users/hanneskaeufler/followers","following_url":"https://api.github.com/users/hanneskaeufler/following{/other_user}","gists_url":"https://api.github.com/users/hanneskaeufler/gists{/gist_id}","starred_url":"https://api.github.com/users/hanneskaeufler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hanneskaeufler/subscriptions","organizations_url":"https://api.github.com/users/hanneskaeufler/orgs","repos_url":"https://api.github.com/users/hanneskaeufler/repos","events_url":"https://api.github.com/users/hanneskaeufler/events{/privacy}","received_events_url":"https://api.github.com/users/hanneskaeufler/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular.js/labels/component:%20forms","name":"component: forms","color":"7B947B"},{"url":"https://api.github.com/repos/angular/angular.js/labels/frequency:%20low","name":"frequency: low","color":"bfe5bf"},{"url":"https://api.github.com/repos/angular/angular.js/labels/severity:%20inconvenient","name":"severity: inconvenient","color":"006b75"},{"url":"https://api.github.com/repos/angular/angular.js/labels/type:%20feature","name":"type: feature","color":"00a606"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/angular/angular.js/milestones/27","html_url":"https://github.com/angular/angular.js/milestones/Backlog","labels_url":"https://api.github.com/repos/angular/angular.js/milestones/27/labels","id":489171,"number":27,"title":"Backlog","description":"Holds the backlog of issues and pull requests that have been triaged.\r\n\r\nBefore assigning items to this milestone they should be labelled, at the very least with the correct \"type\" label (i.e. \"issue\", \"pr\", \"bug\", \"regression\", \"chore\", \"docs\", etc).  Preferably you should also check for duplicate issues/PRs, note CLA status and assign \"complexity\" and \"impact\" labels too.","creator":{"login":"IgorMinar","id":216296,"avatar_url":"https://avatars.githubusercontent.com/u/216296?v=3","gravatar_id":"","url":"https://api.github.com/users/IgorMinar","html_url":"https://github.com/IgorMinar","followers_url":"https://api.github.com/users/IgorMinar/followers","following_url":"https://api.github.com/users/IgorMinar/following{/other_user}","gists_url":"https://api.github.com/users/IgorMinar/gists{/gist_id}","starred_url":"https://api.github.com/users/IgorMinar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IgorMinar/subscriptions","organizations_url":"https://api.github.com/users/IgorMinar/orgs","repos_url":"https://api.github.com/users/IgorMinar/repos","events_url":"https://api.github.com/users/IgorMinar/events{/privacy}","received_events_url":"https://api.github.com/users/IgorMinar/received_events","type":"User","site_admin":false},"open_issues":690,"closed_issues":980,"state":"open","created_at":"2013-11-18T23:30:35Z","updated_at":"2015-09-23T20:15:19Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2014-11-21T22:44:58Z","updated_at":"2015-09-23T20:56:12Z","closed_at":null,"body":"Say I have a form which creates nested forms via `ng-repeat` and `ng-form`.\r\n\r\n```html\r\n  <form name=\"categoryForm\">\r\n    <div ng-repeat=\"item in items\">\r\n      <ng-form name=\"tags\">\r\n        Tag Name: <input name=\"name\" ng-model=\"item.name\" required>\r\n        <div ng-if=\"tags.name.$invalid\">This is great from the inside!</div>\r\n      </ng-form>\r\n    </div>\r\n  </form>\r\n```\r\n\r\nThis is great for accessing the form control `tags.name` inside the `ng-form` block. But from the outside, say in the controller, there is no way to get the same control.\r\n\r\n`$scope.categoryForm.tags` is always set to the last control created by the repeated `ng-form`.\r\n\r\nSee http://plnkr.co/edit/SvBAxJFioTIgfs7Wvvk1?p=preview\r\n\r\nIt seems `$scope.categoryForm.tags` should rather be an array of `FormControllers` or something instead of only the last FormController.\r\n\r\nCurrently this has me creating ugly workarounds like\r\n\r\n```html\r\n<ng-repeat=\"...\">\r\n     <ng-form name=\"tags[{{ $index }}]\">...</ng-form>\r\n</ng-repeat>\r\n```\r\n\r\nwhich is possible since https://github.com/angular/angular.js/issues/1404 got closed.\r\n\r\nCould we support something like an array of `FormControllers` or is this creating any other problems I´m not thinking of?"},"comment":{"url":"https://api.github.com/repos/angular/angular.js/issues/comments/142725713","html_url":"https://github.com/angular/angular.js/issues/10165#issuecomment-142725713","issue_url":"https://api.github.com/repos/angular/angular.js/issues/10165","id":142725713,"user":{"login":"dohomi","id":489221,"avatar_url":"https://avatars.githubusercontent.com/u/489221?v=3","gravatar_id":"","url":"https://api.github.com/users/dohomi","html_url":"https://github.com/dohomi","followers_url":"https://api.github.com/users/dohomi/followers","following_url":"https://api.github.com/users/dohomi/following{/other_user}","gists_url":"https://api.github.com/users/dohomi/gists{/gist_id}","starred_url":"https://api.github.com/users/dohomi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dohomi/subscriptions","organizations_url":"https://api.github.com/users/dohomi/orgs","repos_url":"https://api.github.com/users/dohomi/repos","events_url":"https://api.github.com/users/dohomi/events{/privacy}","received_events_url":"https://api.github.com/users/dohomi/received_events","type":"User","site_admin":false},"created_at":"2015-09-23T20:56:12Z","updated_at":"2015-09-23T20:56:12Z","body":"+1 I'm looking for this for a while now. Would be great if a syntax like this would be supported:\r\n```\r\n<div ng-repeat=\"exercise in training.exercises\">\r\n<input  max=\"60\" min=\"0\" type=\"number\"\r\n       ng-model=\"training.exercises[$index].duration\"\r\n       name=\"duration\">\r\n<div ng-messages=\"form.duration.$error\"\r\n     ng-if=\"trainingForm.$submitted || form.duration.$touched\">\r\n    <div ng-message=\"number\">\r\n        <span translate=\"MESSAGE_NUMBER\"></span>\r\n    </div>\r\n    <div ng-message=\"min\">\r\n        <span translate=\"MESSAGE_MIN\"></span>\r\n    </div>\r\n    <div ng-message=\"max\">\r\n        <span translate=\"MESSAGE_MAX\"></span>\r\n    </div>\r\n</div>\r\n</div>\r\n```"}}