fixing angular 1.2 transclusion and recursive template errors

This fixes all the sidebar issues where we are recursively calling templates for nested folders. 

I have also tested it on FF and it works. I'm on OSX, would appreciate if you could run it though linux FF.