Angular From Scratch Tutorial – Index
Angular From Scratch Tutorial – Step 8: Miscellany
Table of Contents
TARGET
Modal’s stuff in general.
NGX-BOOTSTRAP MODAL
Closing the Modal Returns Failure

ERROR TypeError: Cannot read properties of undefined (reading 'hide')
at main.js:1:434209
at UT (main.js:1:69900)
at s (main.js:1:70062)
at HTMLButtonElement.<anonymous>

SOLUTION
BEFORE
The new modal component code:
import { Component, OnInit, TemplateRef } from '@angular/core';
import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal';
@Component({
selector: 'app-deltodo',
templateUrl: './deltodo.component.html',
styleUrls: ['./deltodo.component.scss'],
})
export class DeltodoComponent implements OnInit {
modalRef: BsModalRef;
title: string;
// list: any[] = [];
constructor() {}
ngOnInit(): void {}
}
AFTER
The modal component code:
import { Component, OnInit, TemplateRef } from '@angular/core';
import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal';
@Component({
selector: 'app-deltodo',
templateUrl: './deltodo.component.html',
styleUrls: ['./deltodo.component.scss'],
})
export class DeltodoComponent implements OnInit {
title: string;
constructor(public modalRef: BsModalRef) {}
ngOnInit(): void {}
}
NAVIGATION
Angular From Scratch Tutorial – Index
Angular From Scratch Tutorial – Step 8: Miscellany
Brazilian system analyst graduated by UNESA (University Estácio de Sá – Rio de Janeiro). Geek by heart.