This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Robin Spielmann
Posted Jan 26 - Read on Facebook

Hey, I have a problem with my constructor properties. I've created a class "elementObject" with the properties you can see in the screenshot. Everything works fine, expect the "listIndex" property. The variable "listElements" is from type number filled with the count of existing elements. The value works perfectly in the "name" and "html" properties.

When I create a new object from type elementObject and write "console.log(element.listIndex)" the console report says "undefined"

Where is the issue? Thanks for your help!

1 Comments

Rafael Marin

The Layer constructor will filter out those properties.
After you run super() in the constructor, you'd have to do something like @listIndex = listElements so it becomes an instance variable.

Read the entire post on Facebook