dart-archive / angular.dart

Legacy source repository. See github.com/dart-lang/angular
https://webdev.dartlang.org/angular/
1.24k stars 248 forks source link

bind- syntax doesn't work for camel case attributes #1039

Open antonmoiseev opened 10 years ago

antonmoiseev commented 10 years ago

I have an attribute defined in my component class:

@NgAttr('myAttr')
String myAttr;

New bind- syntax doesn't allow me to bind a value this way:

<my-component bind-my-attr="'myValue'"></my-component>

However it works perfectly fine this way:

@NgAttr('myattr')
String myattr;
<my-component bind-myattr="'myValue'"></my-component>
antonmoiseev commented 10 years ago

Just discovered, bind- also doesn't work if the attribute's value is an expression which refers to a controller's property which has camel case name. Example:

@Controller(/*..*/)
class MyController {
  Quote quote;
}
class Quote {
  String carrierName;
}
<my-component bind-carrier="ctrl.quote.carrierName"></my-component>

However, everything works for lowercase properties:

class Quote {
  String carriername;
}
<my-component bind-carrier="ctrl.quote.carriername"></my-component>