{"action":"created","issue":{"url":"https://api.github.com/repos/formly-js/angular-formly/issues/376","labels_url":"https://api.github.com/repos/formly-js/angular-formly/issues/376/labels{/name}","comments_url":"https://api.github.com/repos/formly-js/angular-formly/issues/376/comments","events_url":"https://api.github.com/repos/formly-js/angular-formly/issues/376/events","html_url":"https://github.com/formly-js/angular-formly/issues/376","id":91954716,"number":376,"title":"Move all ng-model element attributes to a new property","user":{"login":"kentcdodds","id":1500684,"avatar_url":"https://avatars.githubusercontent.com/u/1500684?v=3","gravatar_id":"","url":"https://api.github.com/users/kentcdodds","html_url":"https://github.com/kentcdodds","followers_url":"https://api.github.com/users/kentcdodds/followers","following_url":"https://api.github.com/users/kentcdodds/following{/other_user}","gists_url":"https://api.github.com/users/kentcdodds/gists{/gist_id}","starred_url":"https://api.github.com/users/kentcdodds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentcdodds/subscriptions","organizations_url":"https://api.github.com/users/kentcdodds/orgs","repos_url":"https://api.github.com/users/kentcdodds/repos","events_url":"https://api.github.com/users/kentcdodds/events{/privacy}","received_events_url":"https://api.github.com/users/kentcdodds/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/formly-js/angular-formly/labels/breaking%20change","name":"breaking change","color":"eb6420"},{"url":"https://api.github.com/repos/formly-js/angular-formly/labels/ideas","name":"ideas","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/formly-js/angular-formly/milestones/7","html_url":"https://github.com/formly-js/angular-formly/milestones/7.0.0","labels_url":"https://api.github.com/repos/formly-js/angular-formly/milestones/7/labels","id":1113078,"number":7,"title":"7.0.0","description":"Putting stuff in here that I think would be good to do, but require a breaking change.","creator":{"login":"kentcdodds","id":1500684,"avatar_url":"https://avatars.githubusercontent.com/u/1500684?v=3","gravatar_id":"","url":"https://api.github.com/users/kentcdodds","html_url":"https://github.com/kentcdodds","followers_url":"https://api.github.com/users/kentcdodds/followers","following_url":"https://api.github.com/users/kentcdodds/following{/other_user}","gists_url":"https://api.github.com/users/kentcdodds/gists{/gist_id}","starred_url":"https://api.github.com/users/kentcdodds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentcdodds/subscriptions","organizations_url":"https://api.github.com/users/kentcdodds/orgs","repos_url":"https://api.github.com/users/kentcdodds/repos","events_url":"https://api.github.com/users/kentcdodds/events{/privacy}","received_events_url":"https://api.github.com/users/kentcdodds/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":0,"state":"open","created_at":"2015-05-16T02:45:13Z","updated_at":"2015-06-30T01:51:16Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2015-06-30T01:51:15Z","updated_at":"2015-06-30T12:35:32Z","closed_at":null,"body":"This is kind of a crazy idea and it would definitely take some time for people to migrate so don't worry, I'm thinking about all of these things...\r\n\r\nBut at the same time, I want to make angular-formly more straightforward in the v7.0.0 release if I can. So here's what I'm thinking:\r\n\r\n**Before**:\r\n\r\n```javascript\r\nvm.fields = [\r\n  {\r\n    type: 'input',\r\n    key: 'emailAddress',\r\n    templateOptions: {\r\n      type: 'email',\r\n      required: true,\r\n      label: 'Email Address',\r\n      description: 'Please input your email address so we can spam you',\r\n      onClick: function() {\r\n        alert('I know! How mean is that!?');\r\n      }\r\n    }\r\n  }\r\n];\r\n```\r\n\r\n**After**:\r\n\r\n```javascript\r\nvm.fields = [\r\n  {\r\n    type: 'input',\r\n    key: 'emailAddress',\r\n    templateOptions: {\r\n      label: 'Email Address',\r\n      description: 'Please input your email address so we can spam you'\r\n    },\r\n    ngModelAttrs: {\r\n      type: 'email',\r\n      required: true,\r\n      onClick: function() {\r\n        alert('I know! How mean is that!?');\r\n      }\r\n    }\r\n  }\r\n];\r\n```\r\n\r\nI realize that `ngModelAttrs` exists as a property already. But this is the name that makes most sense to me. Think less about the naming and more about the concept. What do you think of the idea that anything you would normally place on the element with `ng-model` you would put in `ngModelAttrs` rather than sort of mixing it with `templateOptions`?\r\n\r\nThe fact that those things exist as `templateOptions` was kind of a mistake in design and sort of happened, because the `templateOptions` is supposed to be reserved for template authors (except for the few things that the `ngModelAttrsTemplateManipulator` and a few other directives do with it apparently)...\r\n\r\nI personally think this is much more straightforward and easier to learn. Simply stated, anything you normally would place on the `ng-model` element has a counterpart in `ngModelAttrs`.\r\n\r\nThis would be a pretty significant change, but I believe that it would make the library more approachable. I'm anxious to hear what people have to say (even if it's just a :+1:, that's still helpful)."},"comment":{"url":"https://api.github.com/repos/formly-js/angular-formly/issues/comments/117161081","html_url":"https://github.com/formly-js/angular-formly/issues/376#issuecomment-117161081","issue_url":"https://api.github.com/repos/formly-js/angular-formly/issues/376","id":117161081,"user":{"login":"kentcdodds","id":1500684,"avatar_url":"https://avatars.githubusercontent.com/u/1500684?v=3","gravatar_id":"","url":"https://api.github.com/users/kentcdodds","html_url":"https://github.com/kentcdodds","followers_url":"https://api.github.com/users/kentcdodds/followers","following_url":"https://api.github.com/users/kentcdodds/following{/other_user}","gists_url":"https://api.github.com/users/kentcdodds/gists{/gist_id}","starred_url":"https://api.github.com/users/kentcdodds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentcdodds/subscriptions","organizations_url":"https://api.github.com/users/kentcdodds/orgs","repos_url":"https://api.github.com/users/kentcdodds/repos","events_url":"https://api.github.com/users/kentcdodds/events{/privacy}","received_events_url":"https://api.github.com/users/kentcdodds/received_events","type":"User","site_admin":false},"created_at":"2015-06-30T12:35:32Z","updated_at":"2015-06-30T12:35:32Z","body":"I agree @redhead, I don't like the name either (especially since it's already in use and it seems long and ugly to me too). I'd love suggestions on a better one... Perhaps we can consider something that would make sense in both an angular 1 and angular 2 context..."}}