Reputation: 1601
When working with IntelliJ with TypeScript and adding a reference to a new function in an .html, IntelliJ will offer to add this function to the corresponding .component.ts
file.
Example
<div *ngIf="ifConditionIsTrue()">
IntelliJ will add this function to the component:
ifConditionIsTrue(){
}
But I want that new functions will be added like this:
public ifConditionIsTrue():boolean{
}
Is there a way to control the way new functions are added to the .ts files?
Upvotes: 0
Views: 44
Reputation: 4957
You can find configuration for the code generated with a fix in the IDE Preferences | Editor | Code Style | TypeScript - Code Generation. The options you need are Use 'public' modifier
and Prefer explicit types for function declaration returns
.
Upvotes: 3