I am using ajax (via AngularJS) to grab a Google calendar feed and list the latest events on my homepage. This works great, however, Google seems to append the string "Event Status: confirmed" to the events listing at the end of the date. This is what it looks like:
I can't seem to hide "Event Status: confirmed" from the feed. Is there a way I can use AngularJS filter to remove that string from my JSON feed?
The "Event Status: confirmed" text is coming from the event.summary.$tproperty in the JSON feed. This is what the actual property value looks like:
"$t": "When: Sun Nov 15, 2015<br />\n\n\n<br />Event Status: confirmed""
Here's my HTML with AngularJS ng-repeat directive looping through the feed:
<section id="calendarListing" class="col-lg-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Upcoming Events</h3>
</div>
<div class="panel-body" ng-controller="CalCtrl">
<ul class="list-unstyled" ng-repeat="event in events.feed.entry | reverse | limitTo: 3 ">
<li><h4 ng-bind-html="event.title.$t"></h4>
<span ng-bind-html="event.summary.$t"></span>
</li>
</ul>
</div>
<div class="panel-footer"><a href="calendar.php"><i class="fa fa-arrow-circle-right"></i> View full calendar</a></div>
</div>
</section><!--/events-->
Here is my script:
var calApp = angular.module("calApp", ['ngSanitize']);
var feedUrl = 'https://www.google.com/calendar/feeds/ogmda.com_89pas0l9jbhpf053atd83hdj30%40group.calendar.google.com/public/basic?alt=json';
calApp.filter('reverse', function() {
return function(items) {
return items.slice().reverse();
};
});
calApp.controller('CalCtrl', function($http, $scope) {
$http.get(feedUrl).success(function(data) {
$scope.events = data;
console.log(data);
});
});
angular.element(document).ready(function() {
angular.bootstrap(document.getElementById("calendarListing"),['calApp']);
});

$tproperty?