Can I have a class is doing api stuff, for eg user.api.ts which responsible for calling API
user.api.ts wants to use a helper class user.helper.ts with @Injectable() decorator, should my user.api.ts decorate with @Injectable() too?
I found out if user.api.ts is not with the decorator and trying to inject user.helper.ts, the helper would be undefined in user.api.ts, why?
More context:
user.api.ts
export class UserApi {
}
^ is this wrong? should I decorate it with @Injectable() as well? why? I am not planning to export this class to other modules, it's for internal usage within the modules and it's trying to use some functions from user.helper.ts
user.helper.ts
@Injectable()
export class UserApi {
}
I hope I could get some helps cause I really try to ask a good question in well format, thanks..