Angular Single Service

1. providedIn property of the @Injectable() to "root".

2.  Include the service in the AppModule or in a module that is only imported by the AppModule

https://angular.io/guide/singleton-services

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1.2.

3. 在於Service,設定參數a = Math.random(); ,就可知是否為Single Service

在登入、選單裡的WebService是為同一個,因a參數 random相同。