{"action":"opened","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/12199","labels_url":"https://api.github.com/repos/angular/angular.js/issues/12199/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/12199/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/12199/events","html_url":"https://github.com/angular/angular.js/issues/12199","id":90526395,"number":12199,"title":"ng-class object notation fails to render if class name contains a hyphen  or underscore","user":{"login":"RoxKilly","id":12346501,"avatar_url":"https://avatars.githubusercontent.com/u/12346501?v=3","gravatar_id":"","url":"https://api.github.com/users/RoxKilly","html_url":"https://github.com/RoxKilly","followers_url":"https://api.github.com/users/RoxKilly/followers","following_url":"https://api.github.com/users/RoxKilly/following{/other_user}","gists_url":"https://api.github.com/users/RoxKilly/gists{/gist_id}","starred_url":"https://api.github.com/users/RoxKilly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoxKilly/subscriptions","organizations_url":"https://api.github.com/users/RoxKilly/orgs","repos_url":"https://api.github.com/users/RoxKilly/repos","events_url":"https://api.github.com/users/RoxKilly/events{/privacy}","received_events_url":"https://api.github.com/users/RoxKilly/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-24T00:32:19Z","updated_at":"2015-06-24T00:32:19Z","closed_at":null,"body":"Angular: 1.4.1\r\n\r\nSuppose a variable in the scope is set to <code>v=true</code>.  In the view,  we want to add class <code>panel-error</code> when the variable is false, and <code>panel-success</code> when the variable is true.\r\n\r\nIf we use the directive  <code>ng-class=\"{panel-error:!v,panel-success:v}\"</code>, Angular will get confused by the hyphen character (\"-\"), will fail to parse the class name correctly and will not add either class to the DOM element.  If we remove the hyphen,  things work as they should.\r\n\r\nAdditional note: the underscore character  (\"_\") also causes this failure.\r\n\r\nhttp://plnkr.co/edit/JNSTCu3siuC0QVBHU9VM?p=preview "}}