How to get the "this" from parent function <p>I am building a simple tab system with angularjs, but I'm having trouble referring to <code>this</code> in the parent function. I know I might be misunderstanding some fundamentals, so please educate me:</p> <p>js:</p> <pre><code>$scope.tabs = { _this: this, // doesn't work open: function(elem) { $scope.tabsOpen = true; if(elem) $scope[elem] = true; }, close: function() { $scope.tabsOpen = false; }, about: { open: function() { $scope.aboutOpen = true; _this.notification.close(); // doesn't work $scope.tabs.notification.close(); // works }, close: function() { $scope.aboutOpen = false; } }, notification: { open: function() {/*etc*/}, close: function() {/*etc*/} }, message: { open: function() {/*etc*/}, close: function() {/*etc*/} }, } </code></pre>