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);
}
}