define angular controller function to handle delete user