Controller is responsible for the main logic of the page. Directive is similar to the concept of web components. It takes out a part of the page and encapsulates it into a Directive that is referenced in the page through tags. A Directive contains the HTML template and business logic of this component. Service abstracts functions independently and uses them flexibly through dependency injection
Simply can be understood as controller: controlling data interaction and simple page interaction. If page interactions become complex, they can be extracted separately and encapsulated into instructions, and the service can provide commonly used data request services. Of course, these are just the tip of the iceberg. If you dig deeper, you will find that they have far more functions than these~
Controller is responsible for the main logic of the page. Directive is similar to the concept of web components. It takes out a part of the page and encapsulates it into a Directive that is referenced in the page through tags. A Directive contains the HTML template and business logic of this component. Service abstracts functions independently and uses them flexibly through dependency injection
Simply can be understood as controller: controlling data interaction and simple page interaction. If page interactions become complex, they can be extracted separately and encapsulated into instructions, and the service can provide commonly used data request services. Of course, these are just the tip of the iceberg. If you dig deeper, you will find that they have far more functions than these~