Created
August 30, 2016 15:19
-
-
Save matmkian/e7fd7786bf5323d20fc0e525c997c8bc 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
(function() | |
{ | |
'use strict'; | |
angular | |
.module('Controllers') | |
.controller('MyController', MyController); | |
/* @ngInject */ | |
function MyController($scope, MyService) | |
{ | |
var vm = this; | |
// Private members | |
var _privateMember = 'example'; | |
// Public members | |
vm.publicMember = 'example'; | |
// Public methods | |
vm.publicMethod = publicMethod; | |
// Public services | |
vm.MyService = MyService; | |
// Watchers | |
$scope.$watch('value', _privateMethod); | |
// Init controller | |
_init(); | |
//////////////////////////////////// | |
/** | |
* Method description | |
* @private | |
*/ | |
function _init() | |
{ | |
// Nothing to do | |
} | |
/** | |
* Method description | |
* @private | |
* @param {object} newValue | |
* @param {object} oldValue | |
*/ | |
function _privateMethod(newValue, oldValue) | |
{ | |
// Nothing to do | |
} | |
//////////////////////////////////// | |
/** | |
* Method description | |
* @param {string} param | |
* @return {string} | |
*/ | |
function publicMethod(param) | |
{ | |
_privateMember = param; | |
return _privateMember; | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment