Angular | How to get lng and lat with event click in map?

Hi, I’m trying to develop the example: “taxi cars dispatcher” with angular but I can not get the latitude and longitude when I do click in map.

How I can do develop this code in typescript and angular?

map.on('click', function (event) {
    **const position = event.lngLat;**{
        key: apiKey,
        position: position
        .go().then(function (results) {

In my component.html I have:
< div id=‘map’

but in my component.ts , I can’t get event.lngLat like the example

How can I do this?


Hello, this blog may be helpful:

Just tried and this works:

import { Component } from '@angular/core';
import tt from '@tomtom-international/web-sdk-maps';

  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
export class AppComponent {
  title = 'angular-events';

  ngOnInit() { ={
      key: '<your-api-key>',
      container: 'map',
      style: 'tomtom://vector/1/basic-main',
    });'click', function(e) {