Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 B 类中扩展了 A 类,我想在 B 类中使用 A 类方法。
要在两个控制器之间共享方法,请将函数放在AppController.
AppController
要共享与单个功能相关的一组方法,请创建一个新组件并在两个控制器中使用它。这是正确的 OOP 方式。