{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/12581","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/12581/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/12581/comments","events_url":"https://api.github.com/repos/angular/angular/issues/12581/events","html_url":"https://github.com/angular/angular/issues/12581","id":185800483,"number":12581,"title":"Custom Value Accessor in @angular/forms","user":{"login":"mariolenis","id":10168373,"avatar_url":"https://avatars.githubusercontent.com/u/10168373?v=3","gravatar_id":"","url":"https://api.github.com/users/mariolenis","html_url":"https://github.com/mariolenis","followers_url":"https://api.github.com/users/mariolenis/followers","following_url":"https://api.github.com/users/mariolenis/following{/other_user}","gists_url":"https://api.github.com/users/mariolenis/gists{/gist_id}","starred_url":"https://api.github.com/users/mariolenis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariolenis/subscriptions","organizations_url":"https://api.github.com/users/mariolenis/orgs","repos_url":"https://api.github.com/users/mariolenis/repos","events_url":"https://api.github.com/users/mariolenis/events{/privacy}","received_events_url":"https://api.github.com/users/mariolenis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-27T22:55:55Z","updated_at":"2016-10-28T08:28:06Z","closed_at":null,"body":"Hope it helps...\r\n\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\nImplementing ControlValueAccessor function \r\n```\r\nwriteValue(value: any) {\r\n    this._model = value;\r\n}\r\n```\r\n\"value\" is not a cloned object which by default makes the accessor behave like 2-way binding using 1-way binding syntax like this:  \r\n`<custom-as name=\"myFieldName\" [ngModel]=\"myModelVar\"></custom-as>`\r\n\r\n**Plunker:**\r\n[http://plnkr.co/edit/ydUDzkHt7r1cjWkGGUhy?p=preview](http://plnkr.co/edit/ydUDzkHt7r1cjWkGGUhy?p=preview)\r\n\r\n**Expected behavior**\r\n`writeValue(obj: any): void;` \"obj\" should be a cloned object.\r\n\r\n**What is the motivation / use case for changing the behavior?**\r\nI was trying to initialize the component but found that any change at form value produces a change on model\r\n\r\n**Please tell us about your environment:**\r\nWindows 10, Netbeans, NodeJS\r\n\r\n* **Angular version:** 2.1.1\r\n<!-- Check whether this is still an issue in the most recent Angular version -->\r\n\r\n* **Browser:** [all]\r\n \r\n* **Language:** TypeScript 2.0\r\n \r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/256864996","html_url":"https://github.com/angular/angular/issues/12581#issuecomment-256864996","issue_url":"https://api.github.com/repos/angular/angular/issues/12581","id":256864996,"user":{"login":"ClementVidal","id":3739281,"avatar_url":"https://avatars.githubusercontent.com/u/3739281?v=3","gravatar_id":"","url":"https://api.github.com/users/ClementVidal","html_url":"https://github.com/ClementVidal","followers_url":"https://api.github.com/users/ClementVidal/followers","following_url":"https://api.github.com/users/ClementVidal/following{/other_user}","gists_url":"https://api.github.com/users/ClementVidal/gists{/gist_id}","starred_url":"https://api.github.com/users/ClementVidal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClementVidal/subscriptions","organizations_url":"https://api.github.com/users/ClementVidal/orgs","repos_url":"https://api.github.com/users/ClementVidal/repos","events_url":"https://api.github.com/users/ClementVidal/events{/privacy}","received_events_url":"https://api.github.com/users/ClementVidal/received_events","type":"User","site_admin":false},"created_at":"2016-10-28T08:28:06Z","updated_at":"2016-10-28T08:28:06Z","body":"I'd be glad to know if this is a bug or the expected behavior ... \r\n+1"}}
{"actor":{"display_login":"ClementVidal"}}