Home > database >  ERROR TypeError: this.hotKeys is undefined (in Firefox) and ERROR TypeError: Cannot read properties
ERROR TypeError: this.hotKeys is undefined (in Firefox) and ERROR TypeError: Cannot read properties

Time:07-24

Now I'm working with Angular project. I'm trying to initialize the Map object in component's constructor:

import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-hint-for-hotkeys',
  templateUrl: './hint-for-hotkeys.component.html',
  styleUrls: ['./hint-for-hotkeys.component.css']
})
export class HintForHotkeysComponent implements OnInit {

  hotKeys: Map<string, string>;
  keys: any;
  values: any;

  constructor() {
    this.hotKeys.set("Alt N", " - to create a node. (only on page for nodes)");
    this.hotKeys.set("Alt L", " - to create a link. (only on page for links)");
    this.hotKeys.set("Alt F", " - to create the field for creating the new property of the link or node.");
    this.hotKeys.set("Alt S", " - to save a node/a link or changes in it.");
    this.hotKeys.set("Alt D", " - to delete the field for creating the new property of the link or node. Be sure that you're focused on field you want to delete.");
    this.hotKeys.set("Alt R", " - to delete a node or a link.");
    this.hotKeys.set("           
  • Related