Closed Abdizriel closed 8 years ago
You need to export an Angular 1.5 module instead of just the class. We provide a subgenerator to do this for you: yo angular-fullstack:service myservice
.
Ex:
class Foo {}
export default angular.module('myApp.myService', [])
.factory('FooService', Foo)
.name;
I am trying to add service/factory for my component and initialize it in $onInit. However I am getting this error:
You can find what I am doing there: https://gist.github.com/Abdizriel/c170e7579c8d27562743c429d4b2a80c
I have tried few different methods like instead of class export function with services object inside like I was doing in pre 4.0 version or try both methods with export default and results was similar or information that there is no provider for ActivityService.
I would be very glad if somebody could help me solve this issue.