Another Salesforce blog!!!

Salesforce, Apex

October, 2014

Creating Storage Factory in AngularJS

  [codesyntax lang=”javascript”] ‘use strict’; /* Storage Service */ angular .module(‘appname’) .factory(‘$storage’, function($http){   return {createCookie : function(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = “; expires=”+date.toGMTString(); } else var expires = “”; document.cookie = name+”=”+value+expires+”; path=/”; }, readCookie : function(name) { var nameEQ = name + “=”; var […]

Creating Factory in AngularJS

‘use strict’; /* Application Service */ angular .module(‘appname’) .factory(‘$application’, function($resource, $response, $path) { var $application = $resource( $path.rest + ‘/rest/application/:method’, { }, { all: { method: ‘GET’, isArray: true, transformResponse: function(data, header) { return $response.to_resource(data, $application); } } }); $application.prototype.$options = function(){ } return $application; }); [/cc] here is how you will access your newly […]