Services are JavaScript functions that are designed to perform some specific operation. These services can be called by controllers and…