{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/11379","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/11379/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/11379/comments","events_url":"https://api.github.com/repos/angular/angular/issues/11379/events","html_url":"https://github.com/angular/angular/issues/11379","id":175250544,"number":11379,"title":"RC6 Forms: Calling disabled() on FormControl makes entire form invalid","user":{"login":"capi","id":254852,"avatar_url":"https://avatars.githubusercontent.com/u/254852?v=3","gravatar_id":"","url":"https://api.github.com/users/capi","html_url":"https://github.com/capi","followers_url":"https://api.github.com/users/capi/followers","following_url":"https://api.github.com/users/capi/following{/other_user}","gists_url":"https://api.github.com/users/capi/gists{/gist_id}","starred_url":"https://api.github.com/users/capi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capi/subscriptions","organizations_url":"https://api.github.com/users/capi/orgs","repos_url":"https://api.github.com/users/capi/repos","events_url":"https://api.github.com/users/capi/events{/privacy}","received_events_url":"https://api.github.com/users/capi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular/labels/comp:%20forms","name":"comp: forms","color":"c5def5"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-09-06T13:43:27Z","updated_at":"2016-09-13T15:18:56Z","closed_at":"2016-09-07T23:45:20Z","body":"**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 => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n```\r\n\r\n**Current behavior**\r\nIf I call `this.myForm.controls[\"code\"].disable();`, `this.myForm.valid` is always `false`:\r\n\r\n    this.myForm.patchValue({code: 17});\r\n    console.log(this.myForm.valid);\r\n    this.myForm.controls[\"code\"].disable();\r\n    console.log(this.myForm.valid);\r\n\r\nThis outputs\r\n\r\n    true\r\n    false\r\n\r\n\r\n**Expected/desired behavior**\r\nThe form should still be valid, even though the control has been disabled.\r\n\r\n**Reproduction of the problem**\r\nhttp://plnkr.co/edit/B8cA0zzcrt4SjxrGMlRf?p=preview\r\n\r\n\r\n* **Angular version:** 2.0.0-rc.6\r\n \r\n* **Browser:** [Chrome 53.0.2785.92 | Firefox 48 ] \r\n \r\n* **Language:** [TypeScript 1.8] \r\n\r\n* Remarks\r\n\r\nI initially remarked this as a comment in #11271, but I don't want to hijack the other issue, which is about dynamically binding `[disabled]`.\r\nIt could be that PR #11257 fixes this already, but I am not sure, so I decided to file this bug-report."},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/246716998","html_url":"https://github.com/angular/angular/issues/11379#issuecomment-246716998","issue_url":"https://api.github.com/repos/angular/angular/issues/11379","id":246716998,"user":{"login":"unsafecode","id":1794924,"avatar_url":"https://avatars.githubusercontent.com/u/1794924?v=3","gravatar_id":"","url":"https://api.github.com/users/unsafecode","html_url":"https://github.com/unsafecode","followers_url":"https://api.github.com/users/unsafecode/followers","following_url":"https://api.github.com/users/unsafecode/following{/other_user}","gists_url":"https://api.github.com/users/unsafecode/gists{/gist_id}","starred_url":"https://api.github.com/users/unsafecode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unsafecode/subscriptions","organizations_url":"https://api.github.com/users/unsafecode/orgs","repos_url":"https://api.github.com/users/unsafecode/repos","events_url":"https://api.github.com/users/unsafecode/events{/privacy}","received_events_url":"https://api.github.com/users/unsafecode/received_events","type":"User","site_admin":false},"created_at":"2016-09-13T15:18:56Z","updated_at":"2016-09-13T15:18:56Z","body":"@kara @marcalj  We are experiencing the same behavior, and it looks quite troublesome to solve: on one hand, we could code the dynamic enable/disable behavior by subscribing to `valueChanges `of `FormControl`, but it requires lot of code each time (and we have large forms with many fields).\r\n\r\nOn the other hand, I was thinking about a custom directive to replace `disable`, taking the `FormControl `and an `Observable`, in order to keep the reactive approach in templates, but I need to experiment with it."}}
{"actor":{"display_login":"unsafecode"}}