So, here is the plunkr. The js is sidebareffect. How can I extend the directive to make it cleaner? Thanks!