import { Component, OnInit } from '@angular/core'; import { HttpClient } from '@angular/common/http'; @Component({ selector: 'na-home', templateUrl: './home.component.html', styleUrls: ['./home.component.scss'] }) export class HomeComponent implements OnInit { name = 'home works!'; constructor(private http: HttpClient) { } ngOnInit() { const m = new Map(); m.set('hhh', null); m.set('jjj', undefined); m.set('kkk', 'kkk'); this.http.post('user/login', { 'TIMEOUT': 1000, 'asda': 'asfdsdaf', 'eee': 21312, 'dsfgdfg': null, 'dsssfgdfg': 'null', 'tyjrtyj': undefined, 'tyjrsdstyj': 'undefined', date1: new Date(), date2: new Date().getTime(), 'obj': { 'a': null, 'b': undefined, 'c': 'cccc', 'd': true, 'dd': 'undefined' }, 'array1': [ '1', '2', '3', null, '4', undefined, '5', 'undefined' ], 'array2': [ { 'aa': 'aa', 'bb': null, 'cc': undefined } ], 'xyy': m }).subscribe(); } }