ddubrava / angular-yandex-maps

πŸ—ΊοΈ Yandex.Maps Angular components that implement the Yandex.Maps JavaScript API
https://ddubrava.github.io/angular8-yandex-maps/#/
MIT License
58 stars 8 forks source link

Add an error if a forRoot method is used not in a root module #196

Closed ddubrava closed 1 year ago

ddubrava commented 1 year ago

πŸš€ Feature Request

✍️ Description

forRoot must be used only in a root module, check this article - https://angular.io/guide/singleton-services#the-forroot-pattern. So we should add an error if it's imported in children modules.

ddubrava commented 1 year ago

We can't add an error, it seems it's not possible to determine when forRoot is used outside of a root module. We can only determine when it's used twice but it's not the solution.

Add some documentation changes here - https://github.com/ddubrava/angular8-yandex-maps/commit/4e1a082d46a58495a567e46ca335b992c71c0c53