Skip to content

Instantly share code, notes, and snippets.

@duryjames
Created September 26, 2013 12:19
Show Gist options
  • Select an option

  • Save duryjames/6713374 to your computer and use it in GitHub Desktop.

Select an option

Save duryjames/6713374 to your computer and use it in GitHub Desktop.
function SocialService($FacebookService, $TwitterService){
this.getAuth = function (string) {
var service = getSocialById(string);
return service.getAuth();
}
this.getName = function (string) {
var service = getSocialById(string);
service.getName();
}
this.getSocialById = function (string){
switch (string){
case "facebook":
return $FacebookService;
break;
case "twitter":
return $TwitterService;
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment