Skip to content

fix(@angular/cli): allow backticks in templateUrl and styleUrls#8666

Merged
filipesilva merged 1 commit intoangular:masterfrom
DetectiveQuack:templateStyleUrls
Nov 30, 2017
Merged

fix(@angular/cli): allow backticks in templateUrl and styleUrls#8666
filipesilva merged 1 commit intoangular:masterfrom
DetectiveQuack:templateStyleUrls

Conversation

@DetectiveQuack
Copy link
Contributor

resolves #7945

Copy link
Contributor

@filipesilva filipesilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heya, I think the change looks good, but could you do the test as a unit test in https://github.com/angular/angular-cli/blob/master/packages/@ngtools/webpack/src/transformers/replace_resources.spec.ts please? It's just a matter of making it faster, the e2e tests take longer.

Thanks for taking this on btw!

@DetectiveQuack
Copy link
Contributor Author

No worries, I have updated the PR with the requested changes @filipesilva

if (element.kind == ts.SyntaxKind.StringLiteral) {
if (
element.kind === ts.SyntaxKind.StringLiteral ||
element.kind === ts.SyntaxKind.FirstTemplateToken
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong, it should be ts.SyntaxKind.NoSubstitutionTemplateLiteral. You're not getting the last position of the template token correctly in this case. We probably don't want substitutions in the URLs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake, I have made the relevant changes @hansl

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backticks instead of quotes in styleUrls or templateUrl breaks ng serve/build in CLI ^1.5.0

4 participants