Normally, it is not recommended to rely on the inheritance relationship of the scope to transfer data. Data can be transferred through angular's pub/sub, or data between different scopes can be shared through service. The directive will generate an independent scope only after you specify the scope parameter. The independent scope is for interface isolation and only provides limited external access rights, so that the component can be reused in different environments to implement web components.
Independent components use independent scopes. I feel that in accordance with the componentization concept and performance tuning considerations, independent scopes should be mainly used, and scopes that inherit controller should be avoided as much as possible. According to my practice in the project, I feel that using the controller scope often causes various headaches.
Normally, it is not recommended to rely on the inheritance relationship of the scope to transfer data. Data can be transferred through angular's pub/sub, or data between different scopes can be shared through service. The directive will generate an independent scope only after you specify the scope parameter. The independent scope is for interface isolation and only provides limited external access rights, so that the component can be reused in different environments to implement web components.
Independent components use independent scopes. I feel that in accordance with the componentization concept and performance tuning considerations, independent scopes should be mainly used, and scopes that inherit controller should be avoided as much as possible. According to my practice in the project, I feel that using the controller scope often causes various headaches.