{"action":"created","issue":{"url":"https://api.github.com/repos/angular/material/issues/7910","repository_url":"https://api.github.com/repos/angular/material","labels_url":"https://api.github.com/repos/angular/material/issues/7910/labels{/name}","comments_url":"https://api.github.com/repos/angular/material/issues/7910/comments","events_url":"https://api.github.com/repos/angular/material/issues/7910/events","html_url":"https://github.com/angular/material/issues/7910","id":146270994,"number":7910,"title":"md-autocomplete does not play well the rest of Angular","user":{"login":"timruffles","id":249800,"avatar_url":"https://avatars.githubusercontent.com/u/249800?v=3","gravatar_id":"","url":"https://api.github.com/users/timruffles","html_url":"https://github.com/timruffles","followers_url":"https://api.github.com/users/timruffles/followers","following_url":"https://api.github.com/users/timruffles/following{/other_user}","gists_url":"https://api.github.com/users/timruffles/gists{/gist_id}","starred_url":"https://api.github.com/users/timruffles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timruffles/subscriptions","organizations_url":"https://api.github.com/users/timruffles/orgs","repos_url":"https://api.github.com/users/timruffles/repos","events_url":"https://api.github.com/users/timruffles/events{/privacy}","received_events_url":"https://api.github.com/users/timruffles/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-06T10:41:54Z","updated_at":"2016-04-06T16:48:18Z","closed_at":null,"body":"`<md-autocomplete>` doesn't use the `ng-model` system correctly, requiring hacks to get basic features (`md-input-name`) and making composing it with validators impossible (which is why `required` is manually added within the directive).\r\n\r\nDesired\r\n=======\r\n\r\n```\r\n<form name=\"$ctrl.myForm\">\r\n  <md-autocomplete ng-model=\"$ctrl.item.thing\"\r\n                                 name=\"thing\"\r\n                                 my-custom-validator\r\n  >\r\n```\r\n\r\n1. `mdAutocomplete` uses ng-model as standard, and uses the created `ngModelController` instance\r\n1. Everything else just works - built in validators (`ng-minlength` etc), custom validators (using `ngModelController` API).\r\n\r\nActual\r\n========\r\n\r\n1. Can't use directives like `my-custom-validator` as ng-model is hidden down inside\r\n1. Have to use non-standard `md-input-name` approach\r\n\r\nProposal\r\n=======\r\n\r\nI'm happy fix this if a maintainer would be ok to merge the PR."},"comment":{"url":"https://api.github.com/repos/angular/material/issues/comments/206460547","html_url":"https://github.com/angular/material/issues/7910#issuecomment-206460547","issue_url":"https://api.github.com/repos/angular/material/issues/7910","id":206460547,"user":{"login":"marcomafessolli","id":1048545,"avatar_url":"https://avatars.githubusercontent.com/u/1048545?v=3","gravatar_id":"","url":"https://api.github.com/users/marcomafessolli","html_url":"https://github.com/marcomafessolli","followers_url":"https://api.github.com/users/marcomafessolli/followers","following_url":"https://api.github.com/users/marcomafessolli/following{/other_user}","gists_url":"https://api.github.com/users/marcomafessolli/gists{/gist_id}","starred_url":"https://api.github.com/users/marcomafessolli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcomafessolli/subscriptions","organizations_url":"https://api.github.com/users/marcomafessolli/orgs","repos_url":"https://api.github.com/users/marcomafessolli/repos","events_url":"https://api.github.com/users/marcomafessolli/events{/privacy}","received_events_url":"https://api.github.com/users/marcomafessolli/received_events","type":"User","site_admin":false},"created_at":"2016-04-06T16:48:18Z","updated_at":"2016-04-06T16:48:18Z","body":"#6544 "}}