Fixes #11 Sidebar directive is broken 

Moved logic from controller into link.