TechCrunch
TechCrunch

Reputation: 3134

IntelliJ IDEA does not detect Angular components functions used in component html

I am working on an Angular 2 application and use IntelliJ IDEA for development. I like the feature of showing unused variables. However, if a function is used in component HTML, the component typescript files still say the function is unused. Is there any configuration to avoid this? It is very frustrating as I don't like to see unused variables or functions and if I accidentally delete them, they are not detectable until run time since this is JS.

Update 2017-06-05T14:04:00Z:

IDE Version: IntelliJ IDEA 2017.1.4 Build #IU-171.4694.23, built on June 6, 2017 Mac OS X 10.12.3

Public function in Angular component

backToEdit(): void {
    this.finished = false;
}

Usage in Angular component HTML

<button type="button" (click)="backToEdit()" class="btn btn-default stepy-finish">
    <i class="position-left icon-arrow-left13"></i>Back to Edit
</button>

Upvotes: 1

Views: 1017

Answers (1)

Mouneer
Mouneer

Reputation: 13489

This issue occurs when using Angular2 or AngularJS and it will be fixed for both versions by installing Angularjs plugin.

A quote from the plugin page:

Support for AngularJS and Angular

It's name is a little confusing but it works ;)

Upvotes: 1

Related Questions