searching filtering ibraries in angular 1

searching filtering ibraries in angular

import * as moment from 'moment'; const now = new Date(); // timeAgo also supports moment.js objectsconst lastWeek = moment().subtract(10, 'days');

Here is what the above code is Doing:
1. Importing the timeago pipe from the ng2-timeago package.
2. Importing the moment library.
3. Creating a new Date object.
4. Creating a moment object that represents a date 10 days ago.

Now, let’s use the timeago pipe in our template:

Similar Posts