Exercise: Introduction to Attribute Directives

Let’s practice implementing a custom attribute directive.

We'll cover the following

Let’s practice what we learned and improve our directive for avatars.

Objectives

We’ll create a similar directive to the one in the previous lesson, so that it matches the following criteria:

  • The directive should set the size of the element to 72px x 72px.

  • The directive should add a yellow, 1px-width border to the image.

  • The directive should round the image so that it’s in the same shape as the circle.

  • The directive should only work on <img> element and not any other.

Hint: Think about the selector’s possibilities

Task

Please write the code below:

Get hands-on with 1200+ tech skills courses.