{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/11616","labels_url":"https://api.github.com/repos/angular/angular.js/issues/11616/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/11616/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/11616/events","html_url":"https://github.com/angular/angular.js/issues/11616","id":68918178,"number":11616,"title":"ng-messages no longer interprets its attribute value properly","user":{"login":"davidwalschots","id":1074786,"avatar_url":"https://avatars.githubusercontent.com/u/1074786?v=3","gravatar_id":"","url":"https://api.github.com/users/davidwalschots","html_url":"https://github.com/davidwalschots","followers_url":"https://api.github.com/users/davidwalschots/followers","following_url":"https://api.github.com/users/davidwalschots/following{/other_user}","gists_url":"https://api.github.com/users/davidwalschots/gists{/gist_id}","starred_url":"https://api.github.com/users/davidwalschots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidwalschots/subscriptions","organizations_url":"https://api.github.com/users/davidwalschots/orgs","repos_url":"https://api.github.com/users/davidwalschots/repos","events_url":"https://api.github.com/users/davidwalschots/events{/privacy}","received_events_url":"https://api.github.com/users/davidwalschots/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular.js/labels/branch:%201.4.x","name":"branch: 1.4.x","color":"fad8c7"},{"url":"https://api.github.com/repos/angular/angular.js/labels/branch:%201.5.x","name":"branch: 1.5.x","color":"207de5"},{"url":"https://api.github.com/repos/angular/angular.js/labels/component:%20ngMessages","name":"component: ngMessages","color":"c7def8"},{"url":"https://api.github.com/repos/angular/angular.js/labels/severity:%20regression","name":"severity: regression","color":"e11d21"},{"url":"https://api.github.com/repos/angular/angular.js/labels/type:%20bug","name":"type: bug","color":"000000"}],"state":"open","locked":false,"assignee":{"login":"Narretz","id":1153097,"avatar_url":"https://avatars.githubusercontent.com/u/1153097?v=3","gravatar_id":"","url":"https://api.github.com/users/Narretz","html_url":"https://github.com/Narretz","followers_url":"https://api.github.com/users/Narretz/followers","following_url":"https://api.github.com/users/Narretz/following{/other_user}","gists_url":"https://api.github.com/users/Narretz/gists{/gist_id}","starred_url":"https://api.github.com/users/Narretz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Narretz/subscriptions","organizations_url":"https://api.github.com/users/Narretz/orgs","repos_url":"https://api.github.com/users/Narretz/repos","events_url":"https://api.github.com/users/Narretz/events{/privacy}","received_events_url":"https://api.github.com/users/Narretz/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/angular/angular.js/milestones/80","html_url":"https://github.com/angular/angular.js/milestones/1.4.x","labels_url":"https://api.github.com/repos/angular/angular.js/milestones/80/labels","id":901585,"number":80,"title":"1.4.x","description":"","creator":{"login":"petebacondarwin","id":15655,"avatar_url":"https://avatars.githubusercontent.com/u/15655?v=3","gravatar_id":"","url":"https://api.github.com/users/petebacondarwin","html_url":"https://github.com/petebacondarwin","followers_url":"https://api.github.com/users/petebacondarwin/followers","following_url":"https://api.github.com/users/petebacondarwin/following{/other_user}","gists_url":"https://api.github.com/users/petebacondarwin/gists{/gist_id}","starred_url":"https://api.github.com/users/petebacondarwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petebacondarwin/subscriptions","organizations_url":"https://api.github.com/users/petebacondarwin/orgs","repos_url":"https://api.github.com/users/petebacondarwin/repos","events_url":"https://api.github.com/users/petebacondarwin/events{/privacy}","received_events_url":"https://api.github.com/users/petebacondarwin/received_events","type":"User","site_admin":false},"open_issues":66,"closed_issues":122,"state":"open","created_at":"2014-12-12T10:36:27Z","updated_at":"2015-11-02T19:57:50Z","due_on":null,"closed_at":null},"comments":15,"created_at":"2015-04-16T12:57:30Z","updated_at":"2015-11-02T20:02:20Z","closed_at":null,"body":"In order to minimize the amount of html needed for validation, at our office, we created a directive on top of ng-messages. Sadly, moving from 1.4.0-beta.4/angular-messages.js to 1.4.0-beta.5/angular-messages.js (and later version). Our code no longer works.\r\n\r\nThe error is as follows:\r\n```\r\nSyntax Error: Token '{' invalid key at column 2 of the expression [{{::messages.fullFieldName}}.$error] starting at [{::messages.fullFieldName}}.$error].\r\n```\r\n\r\nThe template for this directive is as follows:\r\n\r\n```html\r\n<div class=\"validation-message\" ng-messages=\"{{::messages.fullFieldName}}.$error\" ng-show=\"{{::messages.fullFieldName}}.$invalid && !{{::messages.fullFieldName}}.$pending && ({{::messages.formName}}.$submitted || {{::messages.fullFieldName}}.$touched)\">\r\n  <div ng-transclude></div>\r\n</div>\r\n```\r\n\r\nThe directive is defined as follows:\r\n```javascript\r\nfunction indMessages() {\r\n    var controller = function ($element) {\r\n      var vm = this;\r\n      var form = $element.inheritedData('$formController');\r\n\r\n      // Unfortunately required controllers are not injectable into our own controller, only into our link function.\r\n      // Here's a solution, feels a bit hacky but nicer than creating a link function just for this; based on: http://stackoverflow.com/a/21252383/198797; also used in core angular code: https://github.com/angular/angular.js/blob/adcc5a00bf582d2b291c18e99093bb0854f7217c/src/ng/directive/input.js#L1614\r\n      vm.formName = form.$name;\r\n      vm.fullFieldName = vm.formName + '.' + vm.fieldName;\r\n    }\r\n\r\n    controller.$inject = ['$element'];\r\n\r\n    return {\r\n      restrict: 'E',\r\n      require: '^^form',\r\n      templateUrl: '/views/templates/ind-messages.html',\r\n      bindToController: {\r\n        fieldName: \"@for\"\r\n      },\r\n      controllerAs: 'messages',\r\n      transclude: true,\r\n      replace: true,\r\n      scope: true,\r\n\r\n      controller: controller\r\n    };\r\n  }\r\n```\r\n\r\nIs the above due to a programming error on our part? Or was there a change with unexpected side-effects inside the angular-messages.js code?"},"comment":{"url":"https://api.github.com/repos/angular/angular.js/issues/comments/153141149","html_url":"https://github.com/angular/angular.js/issues/11616#issuecomment-153141149","issue_url":"https://api.github.com/repos/angular/angular.js/issues/11616","id":153141149,"user":{"login":"petebacondarwin","id":15655,"avatar_url":"https://avatars.githubusercontent.com/u/15655?v=3","gravatar_id":"","url":"https://api.github.com/users/petebacondarwin","html_url":"https://github.com/petebacondarwin","followers_url":"https://api.github.com/users/petebacondarwin/followers","following_url":"https://api.github.com/users/petebacondarwin/following{/other_user}","gists_url":"https://api.github.com/users/petebacondarwin/gists{/gist_id}","starred_url":"https://api.github.com/users/petebacondarwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petebacondarwin/subscriptions","organizations_url":"https://api.github.com/users/petebacondarwin/orgs","repos_url":"https://api.github.com/users/petebacondarwin/repos","events_url":"https://api.github.com/users/petebacondarwin/events{/privacy}","received_events_url":"https://api.github.com/users/petebacondarwin/received_events","type":"User","site_admin":false},"created_at":"2015-11-02T20:02:20Z","updated_at":"2015-11-02T20:02:20Z","body":"I agree with @Narretz here. I think that this is not something that we should support. We definitely do not encourage interpolation in attributes of directives that expect an expression."}}