Issue #2933Opened August 3, 2020by megarg0 reactions

QUESTION: Is there a way to listen to class name changes

Question

I have created a added a component to the "view". I want to show this component only in view (and not add to model/html thus added to the view).

I would like to pass any "class" assignments or changes to this component. For this, I need to listen to a event for any class assignments. Is this possible?

Answers (1)

megargAugust 3, 20200 reactions
Code SnippetTEXT
I figured it out -- using "update" local hook

_**updated(property: any, value: any, prevValue: any) {
                   for (let i = 0; i < value.models.length; i++) {
                        log.debug('$$$$ :', value.models[i].attributes.name);
                    }
                },**_

I am using " value.models[i].attributes.name" -- is there a better way such as "getClasses" function or something like this?

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.