angular controller snippet updated