Currently, I have a filter function that looks like this:
'use strict';
angular.module('app')
.filter('fromNow', function() {
return function(date) {
return moment(date).fromNow();
}
});
Now, I am attempting to implement this filter in the following code snippet:
<div class="streamline b-l m-b" style="margin-top: 25px;">
<div class="sl-item b-{{activity.module.module_type.color.substr(activity.module.module_type.color.indexOf('-')+1,activity.module.module_type.color.length )}} b-l" ng-repeat="activity in activities">
<div class="m-l">
<div class="text-muted">{{activity.timestamp | filter:fromNow}}</div>
<p>{{activity.module.name}}: {{activity.module.module_type_id == 1 ? 'Gennemført' : activity.score}}</p>
</div>
</div>
</div>
Unfortunately, the filter doesn't seem to be working as expected.
Can someone please point out what may be the issue?