unwrap promises in angularjs