I have a JSON list in Angular that looks like this:
vm.allnews = actualNews;
After checking it with console.log, I can see that it's working fine and I am able to retrieve all news from the array list. Each news item has a title which I can display on the Angular template using the following code:
<div class="card" ng-repeat="news in newsPage.allnews">
{{news.title}}
..
This code works as expected. However, I encounter an issue when I try to send the news title through a form. Here is what I have attempted:
function sendTitle () {
var title = $scope.news.title;
..
Unfortunately, I receive a 'title undefined
' error. Can anyone help me identify the problem and suggest a solution? Thank you.