Last active
August 29, 2015 13:56
-
-
Save ansmith/8960035 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myApp.controller('MyWidgetControl', function($scope, $controller) { | |
$controller('AbstractWidgetControl', {$scope: $scope}); | |
//"Public" functions | |
$scope.myFunction = function() { | |
//... | |
}; | |
//Private functions | |
function myPrivateFn() { | |
} | |
}); |
I actually wanted hoisting here. I wanted the private stuff available immediately in case there was any initialization done inline at the top, but I wanted them at the bottom since they're not the key API functions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
to avoid the effects of hoisting,
function myPrivateFn() {}
should becomevar myPrivateFn = function () {}