Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Consider using angular2-template-loader in templates/Angular2Spa #356

@colltoaction

Description

@colltoaction

Hi guys,

I just stumbled upon angular2-template-loader, and thought it's worth considering for this template (I'll definitely use it in my project from now on).

If you see some component's code like this you'll notice the template and styles are required. This is nice because we don't make as many requests compared to using templateUrl and styleUrls.

But there's a drawback: we're tying our code into Webpack. And that brings some issues like not being able to run the ngc compiler on our code. Surely someone's going to make it work at some point, but it's not working at the moment.

Using the mentioned loader, we're able to write plain Angular code like templateUrl: './app.component.html', while retaining all the benefits from bundling and transparency that Webpack provides.

I tested it and I can even require scss like styleUrls: ['./app.component.scss'], but as a side note, this probably won't work with ngc.

Thanks for your great support!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions