How to create a singleton service in Aurelia?

前端 未结 2 1981
忘了有多久
忘了有多久 2021-01-17 10:11

I\'m pretty new to Aurelia (only been using it a few days) and I love it!

I know how to make a service with Aurelia, but how can I make that service a singleton that

2条回答
  •  一整个雨季
    2021-01-17 11:08

    Just inject it

    By default, the DI container assumes that everything is a singleton instance; one instance for the app. However, you can use a registration decorator to change this.

提交回复
热议问题