Issue #2933šŸ’¬ AnsweredOpened August 3, 2020by megarg0 reactions

Is there a way to listen to class name changes

Quick answerby megarg

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...

Read full answer below ↓

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)

megarg• August 3, 2020

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" f...

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.