我經常不得不在某個類中注入依賴項:
class Foo {
constructor(private userService: UserService) {
}
}
我正在尋找的是UserService我輸入時的型別的代碼完成userService:
class Foo {
constructor(private userSer) { // <-- suggests UserService type so I can get the previous code example
}
}
我知道 Kotlin 和 IntelliJ IDEA 是可能的,但我想知道 TypeScript 和 WebStorm 是否可能。
uj5u.com熱心網友回復:
在設定 | 編輯 | 一般 | 代碼完成,JavaScript,嘗試同時啟用建議變數和引數名稱,并為建議的引數名稱添加型別注釋- 有幫助嗎?
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/479069.html
