Good practices static ion-select

Hello, ionic devs!

I have following :

Playstation 4 Xbox One Switch Etc

When 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!!!

This is a unique problem among the problems I have face before. Seems like duplication can be avoided. I will get back with some trial and error. Meanwhile if you find the solution do reply.

You have to just create one global.ts file in src directory as
export class Global {

// and do your code here intialize all the veriables here as

public static playstation4:any = ;

// now call this variable where you want and assign a value to this where variable from where you want


okay.This is useful for me.Thanks for putting it here.