question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

templateUrl Regex fails to capture when comment follows

See original GitHub issue

In the following legitimate code snippet:

@Component({
    selector: "my-app",
    templateUrl: './app.component.html'
    //styleUrls: ["app.component.css"]
})

or this:

@Component({
    selector: "my-app",
    templateUrl: './app.component.html' //Very important comment
})

the regular expression templateUrlRegex in index.js fails to capture, leaving the URL in the file to be treated as a separate html.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:3
  • Comments:11

github_iconTop GitHub Comments

2reactions
defyjoycommented, Feb 25, 2017

Version - “angular2-template-loader”: “^0.6.2”,

Probably this also has got related to the fact the templateUrl doesnt work without a comma . I found out this peculiar issue today. This does work —

@Component({
    selector: 'home',
    templateUrl: "./home.template.html",
})

But This does not

@Component({
    selector: 'home',
    templateUrl: "./home.template.html"
})

The only difference is the comma after templateUrl: “./home.template.html”

1reaction
GiuseppePiscopocommented, Mar 21, 2017

Is also this issue related to #50 ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I match spaces with a regexp in Bash? - Stack Overflow
Get rid of the square brackets in the regular expression: regexp="templateUrl:\s*'". With the square brackets present, the \s inside gets ...
Read more >
angular2-template-loader - Bountysource
templateUrl Regex fails to capture when comment follows $ 0 ... Created 5 years ago in TheLarkInn/angular2-template-loader with 11 comments. In the following ......
Read more >
Regex gives error instead of matching · Issue #180 - GitHub
E.g. if I run the following code use logos::Logos; ... ... any C-style block comment, and indeed it does seem to match such...
Read more >
Highlight Text Within a String Using Angular and Regular ...
We're going to see how to highlight text within HTML using a query string and simple replace logic. The logic behind what we're...
Read more >
Email Validation in Angular: Full Guide - Mailtrap
To assist us in displaying useful validation and error messages to users, ... Here is the regex Angular email validation pattern: "^[a-z0-9.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found