[英]Uncaught Error: [ng:areq] Argument 'fn' is not a function, got undefined
[英]Error: [ng:areq] Argument 'fn' is not a function, got undefined (problems with Angular service)
我對Angular 1.x服務有疑問。 這是代碼:
export const MyService = () => {
//some code
};
當我嘗試將該服務注入此控制器時...
export default function MyController(MyService) {
'ngInject';
//some code
}
...它引發以下錯誤:
Error: [ng:areq] Argument 'fn' is not a function, got undefined
我該如何解決?
修復!! 這只是一個迷惑的問題
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.