I noticed a weird thing when I was writing an angular directive. In the isolated scope of the directive, if I bind an attribute using myAttr: '@' to the parent scope variable with the same name, and then use that attribute in the html template, there will be an extra space trailing the attribute value. If the attribute is bound to the parent scope variable with a different name using myAttr: '@thatAttr', however, there is no extra space and the world is happy.
Please see this jsFiddle for a demonstration. As you can see, the css rules under div[bad=foo] is not applied because of the extra space, while div[good=bar] is perfectly fine.
The fiddle uses Angular 1.3 by the way. Does anyone know why this is the case?
Known bug in Angular, likely will not be fixed
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With