{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/2406","labels_url":"https://api.github.com/repos/angular/angular/issues/2406/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/2406/comments","events_url":"https://api.github.com/repos/angular/angular/issues/2406/events","html_url":"https://github.com/angular/angular/issues/2406","id":86193320,"number":2406,"title":"using ng-form-model directive throws exception","user":{"login":"rolandjitsu","id":1479737,"avatar_url":"https://avatars.githubusercontent.com/u/1479737?v=3","gravatar_id":"","url":"https://api.github.com/users/rolandjitsu","html_url":"https://github.com/rolandjitsu","followers_url":"https://api.github.com/users/rolandjitsu/followers","following_url":"https://api.github.com/users/rolandjitsu/following{/other_user}","gists_url":"https://api.github.com/users/rolandjitsu/gists{/gist_id}","starred_url":"https://api.github.com/users/rolandjitsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rolandjitsu/subscriptions","organizations_url":"https://api.github.com/users/rolandjitsu/orgs","repos_url":"https://api.github.com/users/rolandjitsu/repos","events_url":"https://api.github.com/users/rolandjitsu/events{/privacy}","received_events_url":"https://api.github.com/users/rolandjitsu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-08T14:14:36Z","updated_at":"2015-06-08T22:45:25Z","closed_at":null,"body":"After I updated to version `26`, the forms I had no longer work. After I looked through the source code I found some examples of how to use forms now:\r\n\r\n```html\r\n<article>\r\n\t<h1>Tasks</h1>\r\n\t<form [ng-form-model]=\"todo\" (submit)=\"add($event, desc.value)\">\r\n\t\t<input name=\"desc\" type=\"text\" ng-form-control=\"desc\" [value]=\"desc.value\" placeholder=\"Description\" required>\r\n\t\t<button>Add</button>\r\n\t</form>\r\n\t<ul>\r\n\t\t<li *ng-for=\"#task of tasks\">\r\n\t\t\t<task [model]=\"task\"></task>\r\n\t\t</li>\r\n\t</ul>\r\n</article>\r\n```\r\n```js\r\n@Component({\r\n\tselector: 'todos',\r\n\tappInjector: [\r\n\t\tTasks\r\n\t]\r\n})\r\n\r\n@View({\r\n\ttemplateUrl: 'app/components/todos/todos.html',\r\n\tdirectives: [\r\n\t\tNgFor,\r\n\t\tformDirectives,\r\n\t\tTask\r\n\t]\r\n})\r\n\r\nexport class Todos {\r\n\tconstructor(@Inject(FormBuilder) builder, @Inject(Tasks) tasks) {\r\n\t\tthis._tasks = tasks;\r\n\t\tthis.tasks = tasks.entries;\r\n\t\tthis.todo = builder.group({\r\n\t\t\t'desc': ['', Validators.required]\r\n\t\t});\r\n\t\tthis.desc = this.todo.controls.desc;\r\n\t}\r\n\tadd(event, value) {\r\n\t\tevent.preventDefault();\r\n\t\tif (!value || !value.length) return;\r\n\t\tthis._tasks.add(value);\r\n\t\tthis.desc.updateValue('');\r\n\t}\r\n}\r\n```\r\nBut I keep getting an exception:\r\n\r\n![screenshot 2015-06-08 16 12 21](https://cloud.githubusercontent.com/assets/1479737/8036606/32093380-0df9-11e5-840b-d4468e85617c.png)\r\n\r\nI've tried all combinations I could think of (of directives), but I cannot seem to be able to figure out why I keep getting that exception.\r\nAny pointers on why is that happening?"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/110164961","html_url":"https://github.com/angular/angular/issues/2406#issuecomment-110164961","issue_url":"https://api.github.com/repos/angular/angular/issues/2406","id":110164961,"user":{"login":"mhevery","id":111951,"avatar_url":"https://avatars.githubusercontent.com/u/111951?v=3","gravatar_id":"","url":"https://api.github.com/users/mhevery","html_url":"https://github.com/mhevery","followers_url":"https://api.github.com/users/mhevery/followers","following_url":"https://api.github.com/users/mhevery/following{/other_user}","gists_url":"https://api.github.com/users/mhevery/gists{/gist_id}","starred_url":"https://api.github.com/users/mhevery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhevery/subscriptions","organizations_url":"https://api.github.com/users/mhevery/orgs","repos_url":"https://api.github.com/users/mhevery/repos","events_url":"https://api.github.com/users/mhevery/events{/privacy}","received_events_url":"https://api.github.com/users/mhevery/received_events","type":"User","site_admin":false},"created_at":"2015-06-08T22:45:25Z","updated_at":"2015-06-08T22:45:25Z","body":"It seems like your binding `[value]=\"desc.value\"` is throwing an error because `desc` is null. "}}