79479920

Date: 2025-03-02 23:44:36
Score: 1
Natty:
Report link

The solution above did not work for me, but the approach below did. I created a static property and setter function as below.

@Injectable()
export class SignupPipe implements PipeTransform<any> {
    private static USER_SERVICE: UserService;
    public static setUserService(userService: UserService) { 
        SignupPipe.USER_SERVICE = userService;
    }
    
}

Then in the constructor of the Controller I set the UserService as below

@Controller("user")
export class UserController {
    constructor(private userService: UserService) { 
        SignupPipe.setUserService(userService);
    }
}
Reasons:
  • Blacklisted phrase (1): did not work
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Nqobizwe Ngubane