Angular2/ASP.NET - “No ResourceLoader implementation has been provided. Can't read the URL”

前端 未结 7 1261
名媛妹妹
名媛妹妹 2021-02-13 19:24

I\'m trying to build my own Angular 2/ASP.NET SPA on Visual Studio. You can find all the files here.

What I tried to do is simple: after I followed the instructions to

7条回答
  •  再見小時候
    2021-02-13 19:41

    The UniversalModule currently requires that external assets for templates and styles use require().

    Try changing templateUrl: './test.component.html' to template: require('./test.component.html').

    And styleUrls: ['./test.component.css'] to styles: [require('./test.component.css')]

    More details on the issue can be found here: Unable to load assets without using require()

    For reference, here is the issue thread from Angular on Github: track runtime styleUrls. They recommend using the angular2-template-loader.

提交回复
热议问题