Skip to content

Instantly share code, notes, and snippets.

@adoueb
adoueb / Angular: service, factory, provider
Last active August 29, 2015 14:02 — forked from Mithrandir0x/gist:3639232
Differences between AngularJS services, factories and providers
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!";
@adoueb
adoueb / 0_reuse_code.js
Created February 24, 2014 20:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console