Skip to content

Instantly share code, notes, and snippets.

@ashleyhindle
Created August 20, 2015 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashleyhindle/ca29f4533e280c8609d6 to your computer and use it in GitHub Desktop.
Save ashleyhindle/ca29f4533e280c8609d6 to your computer and use it in GitHub Desktop.
angular-factory.js
var app = angular.module('cheeseBurgerApp', ['ngStorage', 'ngCookies']);
app.factory('storageFactory', ['ngStorage', function($localStorage) {
return $localStorage.$default(config.defaultStorageObject);
}]);
app.controller('MainCtrl', ['storageFactory', function($storageFactory, $scope, $rootScope, $modal, $log, $cookies, $http) {
console.log($storageFactory.data)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment