I played with angularJS directive to solve a problem I had at work.