Expression expected typescript if statement