mock-angular.js
function delay(mock, response) {
				if (!mock || !mock.delay) {
					return response;
				}
				return $q(function(resolve, reject) {
					setTimeout(function() {
						resolve(response);
					}, mock.delay);
				});
			}
function delay(mock, response) {
				if (!mock || !mock.delay) {
					return response;
				}
				return $q(function(resolve, reject) {
					setTimeout(function() {
						resolve(response);
					}, mock.delay);
				});
			}
function delay ( mock , response ) { if ( ! mock || ! mock . delay ) { return response ; } return $q ( function ( resolve , reject ) { setTimeout ( function ( ) { resolve ( response ) ; } , mock . delay ) ; } ) ; }
Insert optional delay in response
@param mock
@param response
@returns {*}
Insert optional delay in response