[英]Error: [ng:areq] Argument 'fn' is not a function, got undefined (problems with Angular service)
I have a problem with an Angular 1.x Service. 我对Angular 1.x服务有疑问。 This is the code: 这是代码:
export const MyService = () => {
//some code
};
And when I try to inject that Service into this Controller... 当我尝试将该服务注入此控制器时...
export default function MyController(MyService) {
'ngInject';
//some code
}
...it throws the following error: ...它引发以下错误:
Error: [ng:areq] Argument 'fn' is not a function, got undefined
How can I fix it? 我该如何解决?
Fixed it!! 修复!! It was just a matter of mistyping 这只是一个迷惑的问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.