Skip to content

Instantly share code, notes, and snippets.

@vitalybe
Created May 8, 2014 08:10
Show Gist options
  • Save vitalybe/b8b3714e0b2f3b099ac1 to your computer and use it in GitHub Desktop.
Save vitalybe/b8b3714e0b2f3b099ac1 to your computer and use it in GitHub Desktop.
Suggested controller/service structure
{
// 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