A service એ એક class છે જે non-UI logic માટે છે — data fetching, business rules, shared state, logging — જે components ફરીથી વાપરી શકે છે। Dependency Injection (DI) એ તે રીત છે કે જેમાં Angular તે services ને components કે જેને તેની જરૂર છે તેને પ્રદાન કરે છે, તેના બદલે components તેમને manually બનાવે છે.
Service ને વ્યાખ્યાયિત કરવું
{ } ;
({ : })
{
users = [];
() { .; }
() { ..(u); }
}
