Skip to main content
added 1 character in body
Source Link
Riscie
  • 4.9k
  • 1
  • 29
  • 33

EDIT: Don't add to your angular-cli.json files scriptscripts section. This is not needed!

You seem to have it right there, just to make sure, here are the steps with how i can reproduce it working on one of my projects:

  • stop the current ng serve
  • do npm install lodash --save and npm install @types/lodash --save-dev
  • In the controler do your import * as _ from 'lodash';
  • Use it like this: console.log(_.chunk(['a', 'b', 'c', 'd'], 2));
  • ng serve again

EDIT: Don't add to your angular-cli.json files script section. This is not needed!

You seem to have it right there, just to make sure, here are the steps with how i can reproduce it working on one of my projects:

  • stop the current ng serve
  • do npm install lodash --save and npm install @types/lodash --save-dev
  • In the controler do your import * as _ from 'lodash';
  • Use it like this: console.log(_.chunk(['a', 'b', 'c', 'd'], 2));
  • ng serve again

EDIT: Don't add to your angular-cli.json files scripts section. This is not needed!

You seem to have it right there, just to make sure, here are the steps with how i can reproduce it working on one of my projects:

  • stop the current ng serve
  • do npm install lodash --save and npm install @types/lodash --save-dev
  • In the controler do your import * as _ from 'lodash';
  • Use it like this: console.log(_.chunk(['a', 'b', 'c', 'd'], 2));
  • ng serve again
Source Link
Riscie
  • 4.9k
  • 1
  • 29
  • 33

EDIT: Don't add to your angular-cli.json files script section. This is not needed!

You seem to have it right there, just to make sure, here are the steps with how i can reproduce it working on one of my projects:

  • stop the current ng serve
  • do npm install lodash --save and npm install @types/lodash --save-dev
  • In the controler do your import * as _ from 'lodash';
  • Use it like this: console.log(_.chunk(['a', 'b', 'c', 'd'], 2));
  • ng serve again