Skip to content

Instantly share code, notes, and snippets.

View paulparton's full-sized avatar

Paul Parton paulparton

View GitHub Profile
@paulparton
paulparton / promiseindentations.js
Last active October 13, 2016 00:08
Promise indentation styles
//Option 1 - function calls on the same line
nameOfMyservice.functionThatReturnsAPromise.then(()=>{
}).then(otherFunction).then(()=>{
}).catch(()=>{
});
//Options 2 - function calls drop to a new line
@paulparton
paulparton / ssc.relatedTasks.js
Last active August 29, 2015 14:08
SSC Website - Related Tasks
var relatedTasks = angular.module('ssc.relatedTasks', ['SeamlessContent']);
/**
* Outer 'relatedTasks' directive collects content definitions from its child 'relatedTask' directives
* and in a single request to SeamlessContent gets all content for each task.
*
* <related-tasks type='optional-template-name'>
* <related-task url='Seamless-CMS-URL'>optional description text</related-task>
* <related-task url='Seamless-CMS-URL'>optional description text</related-task>
* </related-tasks>
@paulparton
paulparton / reportIt.crmsService.js
Created October 31, 2014 05:49
Report It v3 CMRS service connectivity
var crms = angular.module('reportIt.crmsService', ['ngStorage', 'reportIt.config']);
/**
* Crms factory caches data from the CRMS webservice and makes it available as JSON to the app
*/
appServices.factory('Crms',['$http','$q', '$localStorage', 'config', 'cacheTimeOut',
function($http, $q, $localStorage, config, cacheTimeOut){
//Create a promise to return the CRMS objet from the service
@paulparton
paulparton / reportIt.addressService.js
Last active August 29, 2015 14:08
Report It App v3 address web service connectivity
var addressService = angular.module('reportIt.addressService', ['reportIt.config']);
/**
* Connect to the Sutherland shire council property & rating address service to build and validate street addresses
**/
addressService.factory('AddressService',['$http', '$q', 'config',
function($http, $q, config){
//Web service credentials