0

It delays append new data and display old data 1s when I click: https://youtu.be/KeqRdGueekg

In controller:

   myApp.controller('Notebook', function($scope, $http){
    //Display Note click NoteBook
    $scope.xl_note = function(id){
        $http.get("/thunder_note/notebooks/show_note?id=" + id)
            .then(function(response) {
                $scope.dataNote = response.data;
            });
    };
});

In view:

<div class="modal-body">
    <div class="list_body list_body_note_of_notebook">
        <div class="list_content show_noteaas" ng-repeat="data in dataNote.Note">
            <a href="/thunder_note/notes/note_detail/{{data.id}}" style="text-decoration: none;">
                <p class="title">{{data.title}}</p>
            </a>
        </div>
    </div>
</div>

1 Answer 1

1

when you call /thunder_note/notes/note_detail/
you do 2 things calling api and redirecting page the page ridects immidiate so there is allready old data but api response takes some time for getting response so clear $scope.dataNote =""; before your calling api

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

Comments

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.