Last active
December 19, 2015 23:59
-
-
Save egm0121/6038485 to your computer and use it in GitHub Desktop.
Angular Controller Constructor + proto methods
This file contains hidden or 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
.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