Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save IgorMinar/1470771 to your computer and use it in GitHub Desktop.
Save IgorMinar/1470771 to your computer and use it in GitHub Desktop.
Angular: Export Ctrl Methods Proposal
function($ctrlProvider) {
$ctrlProvider.provide('FooCtrl', FooCtrl);
var export = $ctrlProvider.export;
function FooCtrl($http, $scope) {
this.scope_ = $scope;
this.http_ = $http;
}
FooCtrl.prototype.publicMethodA = export(function(){
this.$scope.foo = 'xx';
});
}
// in ng:controller:
$ctrl('FooCtrl', scope);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment