Skip to content

Instantly share code, notes, and snippets.

@egm0121
Last active December 19, 2015 23:59
Show Gist options
  • Save egm0121/6038485 to your computer and use it in GitHub Desktop.
Save egm0121/6038485 to your computer and use it in GitHub Desktop.
Angular Controller Constructor + proto methods
.controller('myCtrl', function(){
var Controller = function($scope) {
var that = this;
this.$scope = $scope;
this.init.apply(this,[].slice.call(arguments,0));
};
Controller.prototype = {
init : function(){
},
customMethod : function(){
this.$scope = 1;
}
};
return Controller;
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment