angular : update method in the controller