0

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?

Pablo
  • 9,424
  • 17
  • 55
  • 78

1 Answers1

1

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>
gwar9
  • 1,082
  • 1
  • 11
  • 28