{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/15586","repository_url":"https://api.github.com/repos/angular/angular.js","labels_url":"https://api.github.com/repos/angular/angular.js/issues/15586/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/15586/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/15586/events","html_url":"https://github.com/angular/angular.js/issues/15586","id":199376727,"number":15586,"title":"Component bindings: {} validation is too restrictive (does not allow dollar sign)","user":{"login":"christopherthielen","id":2053478,"avatar_url":"https://avatars.githubusercontent.com/u/2053478?v=3","gravatar_id":"","url":"https://api.github.com/users/christopherthielen","html_url":"https://github.com/christopherthielen","followers_url":"https://api.github.com/users/christopherthielen/followers","following_url":"https://api.github.com/users/christopherthielen/following{/other_user}","gists_url":"https://api.github.com/users/christopherthielen/gists{/gist_id}","starred_url":"https://api.github.com/users/christopherthielen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christopherthielen/subscriptions","organizations_url":"https://api.github.com/users/christopherthielen/orgs","repos_url":"https://api.github.com/users/christopherthielen/repos","events_url":"https://api.github.com/users/christopherthielen/events{/privacy}","received_events_url":"https://api.github.com/users/christopherthielen/received_events","type":"User","site_admin":false},"labels":[{"id":1639944,"url":"https://api.github.com/repos/angular/angular.js/labels/component:%20$compile","name":"component: $compile","color":"e102d8","default":false},{"id":53079815,"url":"https://api.github.com/repos/angular/angular.js/labels/frequency:%20low","name":"frequency: low","color":"bfe5bf","default":false},{"id":167873,"url":"https://api.github.com/repos/angular/angular.js/labels/PRs%20plz!","name":"PRs plz!","color":"02d7e1","default":false},{"id":83182371,"url":"https://api.github.com/repos/angular/angular.js/labels/severity:%20inconvenient","name":"severity: inconvenient","color":"006b75","default":false},{"id":48406,"url":"https://api.github.com/repos/angular/angular.js/labels/type:%20feature","name":"type: feature","color":"00a606","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/angular/angular.js/milestones/27","html_url":"https://github.com/angular/angular.js/milestone/27","labels_url":"https://api.github.com/repos/angular/angular.js/milestones/27/labels","id":489171,"number":27,"title":"Backlog","description":"Holds the backlog of issues and pull requests that have been triaged.\r\n\r\nBefore assigning items to this milestone they should be labelled, at the very least with the correct \"type\" label (i.e. \"issue\", \"pr\", \"bug\", \"regression\", \"chore\", \"docs\", etc).  Preferably you should also check for duplicate issues/PRs, note CLA status and assign \"complexity\" and \"impact\" labels too.","creator":{"login":"IgorMinar","id":216296,"avatar_url":"https://avatars.githubusercontent.com/u/216296?v=3","gravatar_id":"","url":"https://api.github.com/users/IgorMinar","html_url":"https://github.com/IgorMinar","followers_url":"https://api.github.com/users/IgorMinar/followers","following_url":"https://api.github.com/users/IgorMinar/following{/other_user}","gists_url":"https://api.github.com/users/IgorMinar/gists{/gist_id}","starred_url":"https://api.github.com/users/IgorMinar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IgorMinar/subscriptions","organizations_url":"https://api.github.com/users/IgorMinar/orgs","repos_url":"https://api.github.com/users/IgorMinar/repos","events_url":"https://api.github.com/users/IgorMinar/events{/privacy}","received_events_url":"https://api.github.com/users/IgorMinar/received_events","type":"User","site_admin":false},"open_issues":501,"closed_issues":1506,"state":"open","created_at":"2013-11-18T23:30:35Z","updated_at":"2017-01-09T10:34:04Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2017-01-07T18:29:33Z","updated_at":"2017-01-09T10:40:54Z","closed_at":null,"body":"**Do you want to request a *feature* or report a *bug*?**\r\n\r\nBug\r\n\r\n**What is the current behavior?**\r\n\r\nCurrently, a component can be declared with a binding which includes a dollar sign:\r\n\r\n```js\r\n.component('foo', { \r\n  bindings: { '$fooFactory': '<' }\r\n});\r\n// This works OK\r\n...\r\n<foo $foo-factory=\"$ctrl.$fooFactory\"></foo>\r\n```\r\n\r\nHowever, when re-mapping the input binding to a different attribute name, the mapping validation rejects the \"$\" because it [uses `/\\w+/`](https://github.com/angular/angular.js/blob/b77defde81fc265c13fa504dc78b41a43997abf4/src/ng/compile.js#L986)\r\n\r\n```js\r\n.component('foo', { \r\n  bindings: { 'factory': '<$fooFactory' }\r\n});\r\n// Error: [$compile:iscp] Invalid controller bindings definition for directive 'foo'. Definition: {... factory: '<$fooFactory' ...}\r\n...\r\n<foo $foo-factory=\"$ctrl.$fooFactory\"></foo>\r\n```\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).**\r\n\r\nCreate a component which binds an attribute with a dollar sign to some other controller variable\r\n```js\r\n      app.component('foo', {\r\n        bindings: { factory: '<$fooFactory' },\r\n        template: `<h1>foo</h1>factory: <pre>{{ $ctrl.factory }}</pre>`,\r\n      });     \r\n```\r\nThis plunker shows \r\nhttp://plnkr.co/edit/GNXR5uf05iW5yhdGpceL?p=preview\r\n\r\n**What is the expected behavior?**\r\n\r\nSince the input attribute (with a dollar sign) works when binding to a controller variable of the same name, I expect that the input attribute (with a dollar sign) should work when binding to a variable with a different name.\r\n\r\n**What is the motivation / use case for changing the behavior?**\r\n\r\nIn UI-Router, [resolve data can be bound to component inputs](https://ui-router.github.io/guide/ng1/route-to-component#resolve-bindings).  One extremely important value for ui-router users is `$transition$`, which is the DI token for the current [`Transition` object](https://ui-router.github.io/docs/latest/classes/transition.transition-1.html).\r\n\r\nThe general advice to ui-router users is to bind the transition to the component, if they need information about the current transition, i.e.:\r\n\r\n```js\r\n.component('foo', {\r\n  bindings: { $transition$: '<' }\r\n});\r\n```\r\n\r\nHowever, `$transition$` is admittedly unwieldy, and some users prefer to [rename it when binding to a component](https://github.com/angular-ui/ui-router/issues/3110#issuecomment-267485255).\r\n\r\n**Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.**\r\n\r\nThe isolate bindings validation happens at least back to ng 1.2.32: http://plnkr.co/edit/NOVaM1UlRENnTEwjjTm5?p=preview\r\n\r\n**Other information (e.g. stacktraces, related issues, suggestions how to fix)**\r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular.js/issues/comments/271254160","html_url":"https://github.com/angular/angular.js/issues/15586#issuecomment-271254160","issue_url":"https://api.github.com/repos/angular/angular.js/issues/15586","id":271254160,"user":{"login":"gkalpak","id":8604205,"avatar_url":"https://avatars.githubusercontent.com/u/8604205?v=3","gravatar_id":"","url":"https://api.github.com/users/gkalpak","html_url":"https://github.com/gkalpak","followers_url":"https://api.github.com/users/gkalpak/followers","following_url":"https://api.github.com/users/gkalpak/following{/other_user}","gists_url":"https://api.github.com/users/gkalpak/gists{/gist_id}","starred_url":"https://api.github.com/users/gkalpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkalpak/subscriptions","organizations_url":"https://api.github.com/users/gkalpak/orgs","repos_url":"https://api.github.com/users/gkalpak/repos","events_url":"https://api.github.com/users/gkalpak/events{/privacy}","received_events_url":"https://api.github.com/users/gkalpak/received_events","type":"User","site_admin":false},"created_at":"2017-01-09T10:40:54Z","updated_at":"2017-01-09T10:40:54Z","body":"Sounds reasonable. PRs welcome :smiley:"}}
{"actor":{"display_login":"gkalpak"}}