Skip to content

Instantly share code, notes, and snippets.

@jonnybojangles
Created November 19, 2013 01:08
Show Gist options
  • Save jonnybojangles/7538433 to your computer and use it in GitHub Desktop.
Save jonnybojangles/7538433 to your computer and use it in GitHub Desktop.
A question for later. This in ability makes testing difficult.
provider('widget', [function(){
var that = this;
this.hi = function(){
return 'Hi';
};
this.$get = [function(){
return {
hello : function(){
/*
* How can a provider reference it self?
* */
world();
},
world: function(){
return 'Hello World'
},
hi: function(){
console.log(this.hi());
console.log(that.hi());
}
}
}];
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment