{"action":"opened","issue":{"url":"https://api.github.com/repos/angular/material/issues/1478","labels_url":"https://api.github.com/repos/angular/material/issues/1478/labels{/name}","comments_url":"https://api.github.com/repos/angular/material/issues/1478/comments","events_url":"https://api.github.com/repos/angular/material/issues/1478/events","html_url":"https://github.com/angular/material/issues/1478","id":57409618,"number":1478,"title":"Dynamic Attributes","user":{"login":"ShMcK","id":4660659,"avatar_url":"https://avatars.githubusercontent.com/u/4660659?v=3","gravatar_id":"","url":"https://api.github.com/users/ShMcK","html_url":"https://github.com/ShMcK","followers_url":"https://api.github.com/users/ShMcK/followers","following_url":"https://api.github.com/users/ShMcK/following{/other_user}","gists_url":"https://api.github.com/users/ShMcK/gists{/gist_id}","starred_url":"https://api.github.com/users/ShMcK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShMcK/subscriptions","organizations_url":"https://api.github.com/users/ShMcK/orgs","repos_url":"https://api.github.com/users/ShMcK/repos","events_url":"https://api.github.com/users/ShMcK/events{/privacy}","received_events_url":"https://api.github.com/users/ShMcK/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-12T02:39:03Z","updated_at":"2015-02-12T02:39:03Z","closed_at":null,"body":"I recently attempted to create [`angular-formly` templates for `angular-material`](https://github.com/formly-js/angular-formly-templates-material). This project was unsuccessful as `angular-material` is doing some strange stuff with compiled attributes. \r\n\r\nI'm not sure what is happening to attributes, but I don't think it is a best practice. Perhaps they are being parsed, or `class` is being treated as its own directive rather than the `html` default. \r\n\r\nFor example, styles, which rely on `class`, cannot be added.\r\n\r\n```html\r\n<md-checkbox ng-model=\"model[options.key]\"\r\n             aria-label=\"{{::options.templateOptions.label}}\"\r\n             ng-class=\"::options.templateOptions.className\"> \r\n\t{{::options.templateOptions.label}}\r\n</md-checkbox>\r\n```\r\n\r\nWhen compiled, `ng-class` is ignored in this template, class is unchanged. In other words, templates can't change the color or style. This is true for all `angular-material` form directives except `md-slider`.\r\n\r\nWhen dynamically adding other `ng-directives`, they are added to the attribute as `ngdirective`, without \r\nthe `-`. For example, adding `ng-required` in the compile stage results in:\r\n\r\n```html\r\n<md-checkbox ngrequired=true></md-checkbox>\r\n```\r\n\r\nWha??\r\n\r\nIt's as if `angular-material` has removed all the dynamic functionality that makes `angular` great, and replaced it with their own static directives. Users should be able to add any directives they'd like to a form directive.\r\n\r\nI've also made similar [templates for `LumX`](https://github.com/formly-js/angular-formly-templates-lumx) which work great. You can view them [online](https://formly-lumx.herokuapp.com/). I would love to make templates available for `angular-material`, however, this does not seem currently possible. \r\n\r\nIn conclusion, please make `angular-material` more in line with `html` standards, and remove attribute parsing so users won't run into framework specific road blocks down the road. I think `angular-material` has a lot of potential, and I hope to see more good stuff. "}}