Faker.js: How to use it on angular

Created on 27 May 2018  路  4Comments  路  Source: Marak/faker.js

How to use faker in angular 5 /ionic environment.

Most helpful comment

Angular (6)? Just install and import it like other packages:
npm install faker --save
npm install @types/faker --save
then import into service/file/whatever like:
import * as faker from 'faker'
Profit :)

Also... if you want to import only single locale ( as switching locals does strangely not work with typescript ) - import from
import * as faker from 'faker/locale/de_AT' for example.

All 4 comments

Angular (6)? Just install and import it like other packages:
npm install faker --save
npm install @types/faker --save
then import into service/file/whatever like:
import * as faker from 'faker'
Profit :)

Also... if you want to import only single locale ( as switching locals does strangely not work with typescript ) - import from
import * as faker from 'faker/locale/de_AT' for example.

thank. It is very good library. I Like....

I like it very much too... kudos to the developer ^^

Just a heads up, installing Faker via the commands

npm install faker --save
npm install @types/faker --save

caused issues with two of my napa dependencies. For some reason twitter-bootstrap-wizard and jquery.flot.animator are removed, well the files are removed in node_module directories. Not sure how or why this is happening, but legit the only reason I cannot use it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aadamsx picture aadamsx  路  6Comments

marcelorl picture marcelorl  路  4Comments

developdeez picture developdeez  路  5Comments

minhchu picture minhchu  路  3Comments

pvpshoot picture pvpshoot  路  4Comments