Cannot find html and css file for Angular Dart component

Issue

I am using Angular Dart version ^1.1.2+2. I have a custom Angular component I am using that has a dart file, html file, and css file. When I run in Dartium, everything seems to work fine. However, when I compile everything up and run it in Chrome or Firefox, I get these errors:

GET https://dartlang.org/lib/classes/Controller/PlaybackSignalProcessingController.css net::ERR_CONNECTION_CLOSED html dart2js.dart:18457
GET https://dartlang.org/lib/classes/Controller/PlaybackSignalProcessingController.html net::ERR_CONNECTION_CLOSED html dart2js.dart:18457

This is what the beginning of the .dart file looks like

@Component(
    selector: 'playbackProcessingController',
    templateUrl: 'PlaybackSignalProcessingController.html',
    cssUrl: 'PlaybackSignalProcessingController.css',
    useShadowDom: false)
class PlaybackSignalProcessingController extends MainController {
  PlaybackSignalProcessingController get playbackprocessingctrl => this;

  PlaybackSignalProcessingController(EventBus eb) : super(eb)  {
    print("Playback Signal Processing Controller Constructor");
  }

And I bind the PlaybackSignalProcessingController in the main.dart file. I have also tried using ‘../lib/classes/Controller/PlaybackSignalProcessingController’ for the templateUrl and cssUrl paths and get the same problem. I’m not sure why it cannot find the html and css files. Any ideas? Thanks.

Solution

You can/should access to the file with something like templateUrl: 'packages/my_app/.../PlaybackSignalProcessingController.html'.

Answered By – Alexandre Ardhuin

Answer Checked By – Willingham (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.