Angular2 Dart build gives "The selector "demo-app" did not match any elements" error


I’m porting an existing angular2 ts library to Dart.
Everything’s working in Dartium but after building the app won’t run in Chrome.

I’m getting an “The selector “demo-app” did not match any elements” error.

Not sure how to debug, any help would be appreciated!

Please see for the code.


- dart_to_js_script_rewriter

should be the last transformer.
Also add this setting to the Angular transformer

 - angular2:
platform_directives: 'package:angular2/common.dart#CORE_DIRECTIVES'

See for an example.

You should try to avoid mirrors in browser applications because it causes code bloat. I didn’t chech all your code, but I saw the @MirrorsUsed annotation. If you need reflection, use the reflectable package instead.

Answered By – Günter Zöchbauer

Answer Checked By – Katrina (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.