0

i have set the scope and getting that in console log but on view page modal its showing undefined here is my code :

$scope.showsearchupdate = function($id_protocolo){
var user_path = window.location.pathname;
var arr_path = user_path.split('/');
var search_user = arr_path[2];

$users['get_search_user_update_by_id']($id_protocolo,search_user).then(function(userquestions){
  $scope.userquestions  = userquestions;

  $users['get_search_user_updates'](search_user).then(function(searchuser_updates){
    $scope.searchuser_updates   = searchuser_updates;
  });


$('#search_update').modal('show', {backdrop: 'static'});
console.log($scope.userquestions);
});

}

1 Answer 1

1

Make sure your async call is completed before you open your modal box.

$scope.userquestions = userquestions is being updated inside a promise. You should only call the code for modal box after promise is complete.

Sign up to request clarification or add additional context in comments.

1 Comment

Try to put the code for modal box inside .then function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.