How did I create an app for ux research for five days without any previous experience?!

The other part of the questions, after identifying the problem here, is designing the right solution. My partner doesn’t have time to do garden maintenance , So he wants a gardener to take care of…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Creating and Unit Testing a Theme Switcher Directive in Angular

A while ago I needed a theme/style switcher which could switch themes during runtime. For example, with Theme A activated my buttons would be red, but with Theme B activated my buttons would change from red to blue. There are various ways of accomplishing this, so I decided to do some Googling. A few popular solutions proposed were:

Instead I decided to build a directive which I could apply to any component, and which binds CSS properties to the selected theme properties. For example, the following would bind the color of my h1 tag to a theme property 'textHigh'.

Using a service, I’d then say: The current selected theme is called ‘red’ where 'textHigh' is #FF0000. A fully dynamic and scalable solution!

This article is all about learning. I’ll explain step-by-step how I built this solution. It is suited for anyone who has some basic Angular experience and wants to take his skills to the next level! I will teach you the following:

Add a comment

Related posts:

Hypothesis Testing

Hypothesis testing is used in the statistics to make some strong comment about the population using the sample data i.e. the mean height of two population is equal or not, the coin is biased towards…

Making Sense of Modern Monetary Theory Part 2

In Part 1 we took a look at Modern Monetary Theory’s historical precedents, and illustrated the ideological basis of MMT’s disagreement with various components of present-day fiscal and monetary…

10 Beginner Friedly Proofreading Companies That Hire Newbies

Online proofreading could be the solution you’re looking for. Even if you have no prior experience, you can work full-time, part-time, or as a freelancer. There is a high demand for freelance…