Pablo
Pablo

Reputation: 10620

angular-moment not showing anything

I have in my controller a variable with the current date formatted as yyyy.MM.dd HH:mm:ss

It is being formatted correctly since I'm printing it, and it look fine: 2016.09.01 16:13:15

in my view, I have a span like this:

<span class="date" am-time-ago="notification.datetime | amParse:'YYYY.MM.DD HH:mm:ss'"></span>

I have correctly imported the the code files:

<script src="bower_components/moment/moment.js"></script>
<script src="bower_components/angular-moment/angular-moment.js"></script>

however, nothing is being shown inside the the span, what am I missing?

Upvotes: 0

Views: 121

Answers (1)

gwar9
gwar9

Reputation: 1082

Try adding an angular expression in your span so

<span class="date" am-time-ago="notification.datetime | amParse:'YYYY.MM.DD HH:mm:ss'">{{date|amParse:"YYYY.MM.DD HH:mm:ss"}}</span>

Upvotes: 1

Related Questions