I have a website where I do my routing with Express on the backend. On the frontend I use Angular. The page contains some news messages that I store in MongoDB database. When the read-more button of the message is clicked, I want to open a new page with the info about that news message. These news messages are shown with ng-repeat on the front-end, But I don't know how I can pass this data to a new page.
This is the news message on ng-repeat:
.news_slider.flex
.news_block(ng-repeat="x in news_item")
.upper_image
img(lazy-src="/uploads/{{x.image}}.jpg" animate-visible="true" animate-speed="0.5s")
.lower_text
.title.dark {{x.title}}
.time_stamp {{x.time}}
.text_block(ng-bind-html="x.message") {{x.message}}
a(href="/nieuwsberichten/{{x.title}}/{{x._id}}" target="_self")
.read_more
.main_button.yellow Lees Meer
I do a HTTP call with Angular to the backend to retrieve the data
App.controller("front_page_controller", function($scope, $http){
$scope.showData = function(){
$scope.news_item = {};
$http.get("/news_blocks").then(function (response){
$scope.news_item = response.data;
});
};
});