#24 Component Helper


Let’s say you want to display a different component depending on the user role.  Usually, you can do this

Thanks to the component helper, you can dynamically do this:

In your controller, create the myUserCardComponent property to return the correct component name dynamically.


This tip was inspired by https://dockyard.com/blog/2016/05/13/component-helper


Frontend Weekly
Frontend Weekly
The best articles, links and news related to Frontend Development delivered once a week to your inbox.

Some Love ❤❤❤

If you are enjoying my daily tips please spread the word with this one-click tweet.
If you do NOT like the tips then please reply to this email and let me know.

Published by

Emad Ibrahim

Author of asp .net MVC & TDD, entrepreneur, passionate technologist, programmer and productivity nut. more at http://t.co/oSJXPvzu