bem-components icon indicating copy to clipboard operation
bem-components copied to clipboard

Add setText method to link component

Open losogudok opened this issue 8 years ago • 2 comments

Really need it.

losogudok avatar Apr 28 '16 14:04 losogudok

link.domElem.text('text');

voischev avatar Apr 28 '16 14:04 voischev

@voischev I thought so too. But for example menu__item used getText() method https://github.com/bem/bem-components/blob/v5/common.blocks/menu/__item/menu__item.js#L70

    /**
     * Returns item text
     * @returns {String}
     */
    getText : function() {
        return this.params.text || this.domElem.text();
    },

I think it's a good practice to use the same style API (get, set) in the library

belozer avatar Dec 06 '16 23:12 belozer