Utilizing the Wordpress REST API v2 to fetch data from my functional Wordpress website to an AngularJS application. Everything is functioning properly, however when I attempt to access post meta such as "_ait-item_item-data", it returns an error stating "undefined".
This is the code I am using to retrieve the post meta:
$scope.fieldOne = $scope.businessDetails.post_meta_fields._ait-item_item-data;
And I intend to display:
{{fieldOne}}
I understand that the issue lies in the presence of underscores and hyphens, but how can I extract the meta data with these characters included?
The error displayed in the console is as follows:
ReferenceError: item_item is not defined
at itemSingleCtrl.js:13
at angular.js:16170
at m.$eval (angular.js:17444)
at m.$digest (angular.js:17257)
at m.$apply (angular.js:17552)
at l (angular.js:11697)
at K (angular.js:11903)
at XMLHttpRequest.y.onload (angular.js:11836)