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.

Template local variables with dash (-) in them do not work

See original GitHub issue

That is, this works:

<input #newtodo>
<button (click)="addTodo(newtodo.domElement.value)">Add Todo</button>

But this does not:

<input #new-todo>
<button (click)="addTodo(new-todo.domElement.value)">Add Todo</button>

Nor does this:

<input #newTodo>
<button (click)="addTodo(newTodo.domElement.value)">Add Todo</button>

If it’s not actually supposed to work, we should warn when users do this.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:15 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
svrcekmichalcommented, Jun 2, 2015

@mhevery maybe just mention that in docs somewhere? I have created value newTodo and it cost me bit of time to spot that newtodo in browser

0reactions
angular-automatic-lock-bot[bot]commented, Sep 6, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Backbone Underscore Template not working dash in variable ...
1 Answer 1 ... Underscore templates work by converting your template to a JavaScript function. Things like <%= x %> go straight into...
Read more >
Part 5. Sharing Data Between Callbacks - Dash Plotly
Global variables will break your Dash apps. However, there are other ways to share data between callbacks. This chapter is useful for callbacks...
Read more >
Live template variables | IntelliJ IDEA Documentation - JetBrains
Configure template variables​​ Specify variables in the template text and click Edit variables. In the Edit Template Variables dialog, you can ...
Read more >
Templates and variables - Grafana
No information is available for this page.
Read more >
Using "${a:-b}" for variable assignment in scripts
This technique allows for a variable to be assigned a value if another variable is either empty or is undefined. NOTE: This "other...
Read more >

github_iconTop Related Medium Post

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