Generally when I am working on a project, services serve two purposes: First, they are used as public methods, such as submission methods, certain services in pop-up boxes, and other similar general services. Second, it is used when transferring parameters or objects between certain controllers according to special needs. This situation is rare and is generally not recommended~
When you talk about changing the variables of the top-level controller in the service, I feel that you provided a fragment of your idea, rather than the fundamental demand point~ What is your demand?
It cannot be operated directly, there are two ways: 1. Change the value through the callback function 2. Change the value by passing the object parameters (array, object)
Generally when I am working on a project, services serve two purposes:
First, they are used as public methods, such as submission methods, certain services in pop-up boxes, and other similar general services.
Second, it is used when transferring parameters or objects between certain controllers according to special needs. This situation is rare and is generally not recommended~
When you talk about changing the variables of the top-level controller in the service, I feel that you provided a fragment of your idea, rather than the fundamental demand point~ What is your demand?
It cannot be operated directly, there are two ways:
1. Change the value through the callback function
2. Change the value by passing the object parameters (array, object)
Yes, it is possible, but it is not recommended.
Encapsulate the controller data into an object, and then pass it as a parameter to the factory method.