define angular controller function to handle user add