Skip to content

Instantly share code, notes, and snippets.

@raphaelgabbarelli
Created December 26, 2014 16:41
Show Gist options
  • Save raphaelgabbarelli/60f6778c41bd57ef9da1 to your computer and use it in GitHub Desktop.
Save raphaelgabbarelli/60f6778c41bd57ef9da1 to your computer and use it in GitHub Desktop.
hello, arr and greetingManager complete definitions
// The hello type
var hello = function(){
var self = this;
this.greet = function(name){
console.log("hello " + name);
};
};
hello.$ctor = function(){
return new hello();
}
// the arr type
function arr(){
var self = this;
this.greet = function(name){
console.log("arrrr " + name);
};
};
arr.$ctor = function(){
return new arr();
}
// the greetingManager type
var greetingManager = function(greeter){
self = this;
this.greeter = greeter;
this.greet = function(name){
self.greeter.greet(name);
};
}
greetingManager.$deps = ["greeter"];
greetingManager.$ctor = function(greeter){
return new greetingManager(greeter);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment