• Skip to main content
  • Skip to primary sidebar

Web Development Archive

  • Archive
You are here: Home / Other / Classes getter

Classes getter

public get classes(): string[] {
const deviceType = this.isMobile ? 'mobile' : 'desktop';
return [deviceType];
}
public get classes(): string[] {
const type = `${this.type}`;
return [type];
}
public get classes(): string[] {
const type = `${this.type}`;
const deviceType = this.isMobile ? 'mobile' : 'desktop';
return [type, deviceType];
}
getClasses(): string[] {
const classes = [];
switch (this.data.status) {
case 'unread':
classes.push('unread');
break;
case 'read':
classes.push('read');
break;
case 'archived':
classes.push('archived');
break;
}
return classes;
}

Filed Under: Other

About Gabor Flamich

I'm a web developer and designer based in Budapest, Hungary. In recent years, I've documented hundreds of solutions I came across during development. This site is an archive for useful code snippets on WordPress, Genesis Framework and WooCommerce. If You have any questions related to WordPress development, get in touch!

Primary Sidebar

  • angular.io
© 2026 WP Flames - All Right Reserved