简体   繁体   English

JSDoc用于新的组件绑定

[英]JSDoc for new component bindings

How to write jsdoc for bindings.input so that I receive type hinting in PhpStorm? 如何为bindings.input编写jsdoc,以便在PhpStorm中接收类型提示? I have tried the following jsdoc that I usually annotate my variables with but it ain't working. 我已经尝试了以下jsdoc,通常用它们来注释变量,但无法正常工作。

angular.component('Card', {
            controller : [
                CardController
            ],
            bindings   : {
                /** @type {MyType} */
                /** @param {MyType} input */
                input: '<'
            }
        });

I know that in controller function I can reassign the variable but it smells: 我知道在控制器功能中我可以重新分配变量,但是它闻起来:

/** @type {MyType} */
this.annotatedInput = this.input

This works sometimes /** @type {MyType} */ . 有时可以使用/** @type {MyType} */ I can't think of why sometimes only. 我想不出为什么有时只是。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM