Created
September 16, 2015 16:01
-
-
Save qetr1ck-op/e98dbc733fb7be97877b to your computer and use it in GitHub Desktop.
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
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