first Stack Overflow post!
I'm trying to get my head around Angular, i've used jQuery for years, but im having requests in work to use it.
I'm loading in external JSON through a HTTP reqest..
$http({
method: 'GET',
url: "/Api/News/GetNews?pageNumber=" + pageNumber
}).then(function successCallback(response) {
$scope.myData = response.data
}, function errorCallback(response) {
showError()
});
}
This is working fine and the content is displaying in my NG-Repeat..
<div class="newsRow" ng-repeat="x in myData track by $index">
<div class="col-md-3">
<a href="{{x.Url}}">Read more</a>
</div>
<div class="col-md-9">
<h3><a href="{{x.api.Url}}">{{x.Title}}</a></h3>
<p>{{x.Excerpt}}/p>
{{x.NewsItemVersion}}
</div>
</div>
The only issue is the news ID (NewsItemVersion) needs to be formatted before it is displayed, it needs to be rounded to an integer.
How do I intercept this value and change it before it is displayed?