Updated angular implementation to have form validation