replace alerts with an angular event