Skip to content

Instantly share code, notes, and snippets.

@dealingwith
Created August 4, 2014 21:27
Show Gist options
  • Save dealingwith/24cc8a8241d59c3dab1e to your computer and use it in GitHub Desktop.
Save dealingwith/24cc8a8241d59c3dab1e to your computer and use it in GitHub Desktop.
// This will be the function that requests and stores data.
app.factory('dataFactory', function( ) {
var store = this;
store.products = ['John','Judy','Dijion'];
return {
sayHello: function(text) {
return "Factory says yo: " + text;
},
sayGoodbyeProduct: function() {
return "Factory says prodcucts are " + store.products[0] + ", "; //etc
}
}
// What does an additional function, like "sayHello" look like?
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment