I have a call in controller
vm=this;
User.query()
.$promise
.then(function(resp){
`vm.response = resp`
});
in if
if(!!$stateParams.id){`console.log(vm.response.id);`
}
For edit page I got id undefined. User.query get called after this if. For create it works ok.