Hello, ionic devs!
I have following :
Playstation 4 Xbox One Switch EtcWhen I have a static list and I need to repeat the component in other Pages, what is the best practice to avoid duplication of Code?
Well, When I say duplication is both HTML and TypeScript.
I could create a new component called , but what about the TypeScript? Can I create a const with The values and export It?
Export const CONSOLE = {
playStation4 = ‘Playstation 4’, etc
}
But doing this, How can I import The labels to HTML?
So, I want to avoid duplication of labels too. In Java, I could create a enum for example. If I need to add a New console, I Just need to change the enum, because all enums have a values() method that returns a list of constants.
I need same good practice in Ionic. What should I do?
Thanks, ionic devs!!!