Created
May 8, 2014 08:10
-
-
Save vitalybe/b8b3714e0b2f3b099ac1 to your computer and use it in GitHub Desktop.
Suggested controller/service structure
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
{ | |
// private field init | |
var a = 1; | |
// public field init | |
$scope.b = 1; // For controllers | |
this.c = 1; // For services | |
// call init function | |
init(); | |
function init() { | |
// Initialization logic is here | |
if () { | |
... | |
} | |
} | |
// Public functions | |
this.func = function () { | |
} | |
// Private functions | |
function func2() { | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment