javascript - How to create an object in angular whose properties and methods can be accessed by components in different modules
習慣沉默
習慣沉默 2017-06-26 10:54:24
0
5
953

The properties and methods of this object need to be accessible to components in any module

習慣沉默
習慣沉默

reply all(5)
女神的闺蜜爱上我

Simply create the corresponding component in ShareModule.

世界只因有你

Use the service, please note that the service must be registered in the root module

ringa_lee

You can use services or local storage

ringa_lee

It’s more convenient to use the service.

typecho

Use the run method to define a $rootScope.aa = 1; then you can get $rootScope.aa from other places

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template