angular.dart icon indicating copy to clipboard operation
angular.dart copied to clipboard

When using an NgTwoWay where name matches Component selector

Open jrote1 opened this issue 9 years ago • 0 comments

If an NgTwoAttribute matches a component selector you get an error where is will try to set the property to String. For example:

import 'package:angular/application_factory.dart';
import 'package:angular/angular.dart';

class ExampleModule extends Module{
    ExampleModule(){
        bind(SetupComponent);
        bind(SetupViewComponent);
    }
}

main(){
    var injector = applicationFactory( )
    .addModule( new ExampleModule( ) )
    .run( );
}

class Setup{
    int id;
}

@Component( selector: 'setup', template: '<setupView setup="setup"></setupView>', useShadowDom: false )
class SetupComponent{
    Setup setup = new Setup();
}

@Component( selector: 'setupView', template: '{{setup.id}}', useShadowDom: false )
class SetupViewComponent{
    @NgTwoWay("setup")
    Setup setup;
}

jrote1 avatar Mar 11 '15 10:03 jrote1