185
rated 0 times
[
186]
[
1]
/ answers: 1 / hits: 21496
/ 8 Years ago, thu, january 5, 2017, 12:00:00
In a fairly complicated angular web app, I need the dynamic year to show up in a footer that doesn't have a directive. Is there an angular way to do it using just {{SomeDateFunction()}}
?
I've seen people say {{Date.now() | date:'yyyy'}}
, which doesn't display anything. I've tried {{new Date().getFullYear()}}
which breaks angular and the error says
I don't want to link a scope from the root scope, or put this in a directive just for the year, this is exactly the kind of thing {{ }} expressions should be able to solve, and non-date related simple {{ }} expressions display just fine.
More From » angularjs