Practice Activity

Create a custom rollover image directive which shows one image normally and another when the user hovers over it.

activity example

The directive will be used like so:

<img [ccRollover]="{
  'initial':'https://unsplash.it/200/300?image=201',
  'over':'https://unsplash.it/200/300?image=202'
}"/>

Steps

Fork this blitz:

Flesh out the RolloverImageDirective class to implement the functionality you need.

Read any TODO comments in the blitz for hints.

Solution


Caught a mistake or want to contribute to the book? Edit this page on GitHub!