Skip to content

How to use this package in Angular 4 Application ? #11

Open

Description

@RaviGprec

Simply const safeJsonStringify = require('safe-json-stringify'); doesn't work in Angular 4. Because we have import statements in Angular 2, 4+ vesrion.
require() is not supported any more. If stringify is exported as class then we can import that class in Angular 4.

Could you tell me "Is it supported for this Angular 4 application ?". If yes, tell me how to use it.

Thanks inadvance!!

Activity

  1. gmaughan commented on Mar 4, 2020

    @gmaughan

    If it is still relevant for you, the following works for me:

    import * as safeJsonStringify from 'safe-json-stringify';
    
    const s = safeJsonStringify(obj);
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions