0.0.2 • Published 6 years ago
json-deep-parse v0.0.2
Simple module for parsing huge JSON object.
Installation
First you need to install the npm module:
npm install json-deep-parse --save
Usage
1. Import the JsonDeepParseModule
:
You have to import JsonDeepParseModule
in the root NgModule of your application.
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {JsonDeepParseModule} from 'json-deep-parse';
@NgModule({
imports: [
BrowserModule,
JsonDeepParseModule
],
bootstrap: [AppComponent]
})
export class AppModule { }
2. Just use in Component or Service
After that you can use JSONParserService.parse in your project. (JSONParserService.parse is static method, so you don't need inject this service into component or service)
let jsonObject = JSON.stringify(someObject);
let obj = JSONParserService.parse(jsonObject);
console.log(obj);