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.

injection scope selector of type meta.object-literal not working

See original GitHub issue

I was trying to update and see if natewallace/language-vscode-javascript-angular2 extension works with the new typescript grammar by changing template.ng.json to use meta.object-literal instead of meta.block injection scope selector. The extension doesn’t work because I think it treats the dash as minus operator. I modified the grammar and the injection rule from meta.object-literal to meta.objectliteral and the extension works as expected.

Note this is the typescript code I tried:

import {Component, HostListener, Directive} from 'angular2/core';

@Directive({selector: 'button[counting]'})
class CountClicks {
  numberOfClicks = 0;
  @HostListener('click', ['$event.target']) onClick(btn) {
    console.log("button", btn, "number of clicks:", this.numberOfClicks++);
  }
}
@Component({
  selector: 'my-app',
  template: `<button counting>Increment</button>`,
  directives: [CountClicks]
})
export class AppComponent {
  constructor() { console.clear(); }
}

With the extension working the line should have colors from the scope of tags

template: `<button counting>Increment</button>` 

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mjbvzcommented, Apr 9, 2018

Whoops, pushed to my origin instead of this one. Just pushed here too.

Sorry for the confusion. Will make sure we also have the correct tag

0reactions
alexdimacommented, Apr 9, 2018

@mjbvz … but ecade6c is not in master on this repository

image

I see the tags on this repo are also not respecting the npm published version anymore for v3.3.2

Can we please do the following in the future when publishing to npm:

  1. npm run prepublish
  2. npm version minor or npm version patch as needed. this will modify package.json, create a commit and a tag
  3. git push && git push --tags
  4. npm publish.

Following these simple steps will help that others can easily correlate npm releases with tags and with commits and that the changes are publicly visible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

injection scope selector of type meta.object-literal not working
I was trying to update and see if natewallace/language-vscode-javascript-angular2 extension works with the new typescript grammar by ...
Read more >
Nestjs - How to get injectable scope type from another service
The question was how to check the injection scope type at runtime. I need the method to throw an error when it attempts...
Read more >
Dependency injection in action - Angular
When all dependencies are in place, AppComponent displays the user information. Logged In User. Limit service scope to a component subtreelink. An Angular ......
Read more >
Google Visualization API Reference | Charts
To make a read-only copy of a DataTable (optionally filtered to show specific values, rows, or columns), create a DataView. Each column is...
Read more >
Using :scope in querySelector() takes ~2x longer than without ...
Running a few tests, I'm seeing using :scope takes ~2x longer. ... (a) the first querySelectorAll: checks whether a given element is span...
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