Forked from vojtajina/angular-ctrl-export-proposal.js
Created
December 13, 2011 05:44
-
-
Save IgorMinar/1470771 to your computer and use it in GitHub Desktop.
Angular: Export Ctrl Methods Proposal
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($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