1
I am making a very basic forum and I have a very easy question, but I am beginner at the angle and it is killing me. When creating a new topic, this topic creates an ID ie each topic has its own. In the Index there is a list of created topics and an access button that leads to a given topic. My doubt is how to show the title, subject and description of the topic accessed on the test page. Note: I am using mongod and Postman for data registration, and the url where the data is http://localhost:3000/topic/list
Below the button and the js
$scope.AcessarTopico = function(index){
//$scope.item = $scope.itens[this.id:id];
alert("o id do cara é - " + $scope.itens[index]._id);
window.location="file:///C:/Users/Mayla/Desktop/Forum/teste.html?id="+$scope.itens[index]._id;
$scope.edit = true;
<button class="btn btn-success btn-small" ng-click="AcessarTopico($index)">
In the test you will have the forum title and subject and description items and each forum has an id.
– Mayla Campos
And this data comes from the database
– Mayla Campos
The method you showed is directing the application to test.html! In order for it to work, your.html test has to have a controller! And in your initial method have a get that fetches the data from that forum post!
– Débora Castro
I edited the answer
– Débora Castro
In the id part, I just put - var url = 'http://localhost:3000/topic/list' $http.get(url, {id: $Scope. _id}). then( ... it would take something more than that, since in the bd this _id.
– Mayla Campos