title: Upgrading to Dart2/Angular5 Error importing template.dart
body: <p>I am upgrading my dart/angular project to dart 2.x/angular 5.x. The sample in phpstorm works, but when I build my project, then I am getting following error:</p>
  
  <pre><code>[SEVERE] build_modules|modules on lib/app_component.template.dart:
  
  Bad state: No element
  [SEVERE] build_web_compilers|entrypoint on web/main.dart:
  Unable to find modules for some sources, this is usually the result of either a
  bad import, a missing dependency in a package (or possibly a dev_dependency
  needs to move to a real dependency), or a build failure (if importing a
  generated file).
  
  Please check the following imports:
  
  `import 'package:mfgapp/app_component.template.dart' as ng;` from mfgapp|web/main.template.dart at 8:1
  `import 'package:mfgapp/app_component.template.dart' as ng;` from mfgapp|web/main.dart at 1:1
  </code></pre>
  
  <p>I migrated the project with the guidlines, and dart analysis does not show any errors</p>
  
  <p>Here are some of my files:</p>
  
  <pre><code>main.dart
  import 'package:angular/angular.dart';
  import 'package:mfgapp/app_component.template.dart' as ng;
  
  void main() {
    runApp(ng.AppComponentNgFactory);
  }
  </code></pre>
  
  <p>app_component.dart</p>
  
  <pre><code>import 'package:angular/angular.dart';
  
  
  @Component(
    selector: 'mfgapp',
    styleUrls:  ['package:angular_components/src/components/app_layout/layout.scss.css', 'layout.css', 'app_component.css'],
    templateUrl: 'app_component.html',
  )
  
  
  class AppComponent {
  
  }
  </code></pre>
  
  <p>pubspec.yaml:</p>
  
  <pre><code>name: mfgapp
  description: A web app that uses AngularDart Components
  
  environment:
    sdk: '&gt;=2.0.0-dev.68.0 &lt;3.0.0'
  
  dependencies:
    angular: ^5.0.0-beta
    angular_components: ^0.9.0-beta
  
  dev_dependencies:
    angular_test: ^2.0.0-beta
    build_runner: ^0.9.0
    build_test: ^0.10.2
    build_web_compilers: ^0.4.0
    test: ^1.0.0
  </code></pre>
  
  <p>I reduced my code to indicate the error, but there is no change. Even if I delete the import statement, I am getting error that app_component.template.dart as ref1 cannot be imported.</p>