Guest User

Template example

a guest
Dec 1st, 2016
49
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. service.${serviceMethod.name} = function(
  2. #foreach( $serviceMethodParameter in ${serviceMethod.allParameters} )
  3. ${serviceMethodParameter.name} #if( $foreach.hasNext ), #end
  4. #end #if( $serviceMethod.requestBodyParameter ) #if( ${serviceMethod.allParameters.size()} > 0 ) , #end $serviceMethod.requestBodyParameter.name #end
  5. #if(${serviceMethod.allParameters.size()} > 0 || ${serviceMethod.requestBodyParameter}),#end httpConfig) {
  6. #if( ${serviceMethod.parameters.size()} > 0 || $ieIgnore)
  7. var params = {
  8. #foreach( $serviceMethodParameter in ${serviceMethod.parameters} )
  9. ${serviceMethodParameter.name} : ${serviceMethodParameter.name} #if( $foreach.hasNext || $ieIgnore), #end
  10. #end
  11. #if( $ieIgnore )
  12. helloIE8: new Date().getTime()
  13. #end
  14. };
  15. #end
  16. var body = {
  17. method: '${serviceMethod.methodType}',
  18. url: ${serviceMethod.path}
  19. #if( ${serviceMethod.parameters.size()} > 0 || $ieIgnore),
  20. params: params
  21. #end
  22. #if( $serviceMethod.requestBodyParameter ),
  23. data: JSON.stringify($serviceMethod.requestBodyParameter.name)
  24. #end
  25. };
  26.  
  27. return ${http}(angular.extend({}, body, httpConfig));
  28. };
RAW Paste Data