If two modules provide the same service and are imported into a third module, the service from the ________ module will be used.

  • 'first'
  • 'second'
  • 'third'
  • 'third-party'
When two modules provide the same service and are imported into a third module in Angular, the service from the 'first' module will be used. Angular's dependency injection system follows a hierarchical order for providing services. The first module providing the service takes precedence over the second module, and so on. This ensures that the service is consistent and predictable in its usage.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *