AngularJS Display 1 Post in New Page

后端 未结 2 1654
孤城傲影
孤城傲影 2021-01-26 12:03

I want to display only Test Post 1 in next html page titleDetails.html when user clicks Test Post 1 in index.html

2条回答
  •  北海茫月
    2021-01-26 12:58

    a new scope variable in BlogController

    $scope.postDetail = null;
    

    and method titleDetails() be like

    $scope.titleDetails = function(post) {
    $scope.postDetail = post;
    }
    

    and also make change in index.html

     {{ post.title }} 
    

提交回复
热议问题