javascript api restful name functions, good practices -
i need advise name functions inside service calls restful api (i know there not standards); let's see how used in 2 ways on angular.io site:
- on tutorial , http section : https://angular.io/docs/ts/latest/guide/server-communication.html
save () delete () put () post ()
- on developper guide http, hero.services.ts :
https://angular.io/docs/ts/latest/guide/server-communication.html#!#http- client
getheroes () addhero ()
search() in file: search.services.ts
- on tutorial on web:
http://offering.solutions/articles/angular/consuming-a-rest-api-with-angular-2-http-service-in-typescript/
getall
getsingle
add
update delete
(i don't not camelcase ) names clear
my question is:
a. when functions's name have no object's name , addhero (), use simple add () on service , component consumed ?
b. search service can joined on same file service?
c. there advise api restful?
Comments
Post a Comment