diff --git a/src/ui-layout.js b/src/ui-layout.js index 223b591..9bc8243 100644 --- a/src/ui-layout.js +++ b/src/ui-layout.js @@ -9,6 +9,10 @@ angular.module('ui.layout', []) var ctrl = this; var opts = angular.extend({}, $scope.$eval($attrs.uiLayout), $scope.$eval($attrs.options)); + if (opts.ctrl) { + $scope[opts.ctrl]=ctrl; + } + var numOfSplitbars = 0; //var cache = {}; var animationFrameRequested; @@ -387,7 +391,7 @@ angular.module('ui.layout', []) } } else { // fix for potentially collapsed containers - ctrl.containers[index - 1].collapsed = false; + if (index) ctrl.containers[index - 1].collapsed = false; numOfSplitbars--; }