Added support for root layout element not being the whole window
Fixed ng-show being evaluated in the wrong scope