Hej John,
Unfortunately Angular doesn't support dynamically adding of Directives. That's why the repetition is necessary. As for whether it can be removed, yes. This will be the focus in part 2.
Hey John,
I've now published part 2 where remove the repetition from the template and use a more dynamic approach. Would love to hear what do you think about it :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
How would we remove repetitive code? We see just one attribute changing. Any way to make it dynamic?
Hej John,
Unfortunately Angular doesn't support dynamically adding of Directives. That's why the repetition is necessary. As for whether it can be removed, yes. This will be the focus in part 2.
Hey John,
I've now published part 2 where remove the repetition from the template and use a more dynamic approach. Would love to hear what do you think about it :)