Skip to content
This repository was archived by the owner on May 28, 2024. It is now read-only.

Latest commit

 

History

History
41 lines (29 loc) · 707 Bytes

File metadata and controls

41 lines (29 loc) · 707 Bytes

Third-Party Library Setup

This guide focuses on integrating third-party libraries that are not packaged as Angular modules in alignment with the app architecture generated by Angular CLI.

Specifically, we will look at installing Moment.js

Install Dependencies

yarn add moment

Include Modules

Open angular-cli.json and add moment.

{
  ...
  "apps": [
     ...
     "scripts": [
        "../node_modules/moment/min/moment.min.js"
     ],
     ...
  ]
  ...
}

Start using Moment.js

Open any components and import moment:

import * as moment from 'moment';

Get current date and time:

now: string = moment().format()