Skip to content

Instantly share code, notes, and snippets.

@qetr1ck-op
Created September 16, 2015 16:01
Show Gist options
  • Save qetr1ck-op/e98dbc733fb7be97877b to your computer and use it in GitHub Desktop.
Save qetr1ck-op/e98dbc733fb7be97877b to your computer and use it in GitHub Desktop.
module.provider('greeter3', function() {
var salutation = 'Hello';
this.setSalutation = function(s) {
salutation = s;
}
function Greeter(a) {
this.greet = function() {
return salutation + ' ' + a;
}
}
this.$get = function(a) {
return new Greeter(a);
};
});
//later
module('abc', []).config(function(greeter2Provider) {
greeter2Provider.setSalutation('Halo');
});
function Controller(greeter2) {
expect(greeter2.greet()).toEqual('Halo 123');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment