-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What about any property type in polymer ? #5597
Comments
String or Object would probably be the best 2 choices depending on how you want to use it. |
I know that but this Question is not about using them, it's about the types polymer supports. |
Hi @divyanshu-rawat. The The property type is used only when converting an attribute value to a property value. The process is described here: https://polymer-library.polymer-project.org/3.0/docs/devguide/properties#attribute-deserialization You can use any type you want in the If Polymer doesn't recognize the type, and you don't specify a custom deserializer, the attribute value is used unmodified (this is the same behavior as In the case where your property could take many different types, you probably want to use the TypeScript 'any'. If you want to be able to initialize it from an attribute, If you need more complicated deserialization logic, you can write a custom deserializer. |
@arthurevans sounds good 👍 , as far as I have concluded |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
So, I am basically a frontend developer from Angular, React background and have started to work with Polymer, since 1 month, Just like all JS frameworks and libraries, Polymer 3.0 also utilizes ES6.
So, for instance if I have a
XCustom polymer class
having a propertyuser
declared on it followed by its type.So, if we talk about TS(typescript) then if we declare any property in a class and if we don't know its type then we just write any. like this
user:any .
What about
any
property type in polymer ?The text was updated successfully, but these errors were encountered: