When trying to access this,
I encountered an issue when trying to set the value of this.idHidden to true.
For example: this.idHidden = true
The error message:
TypeError: Cannot set property 'idHidden' of null
And here is the code snippet:
import { Component , Output } from '@angular/core';
import { NgForm } from '@angular/forms';
import * as Datastore from 'nedb';
@Component({
moduleId: module.id,
providers: [],
templateUrl: 'info.component.html'
})
export class InfoComponent {
selkName: any;
insertedSelk: any;
idHidden: false;
selkValidate: number;
constructor(){
this.selkName = '';
this.insertedSelk = [];
this.selkValidate = 1;
this.SelkFinde(this);
}
DeleteSelk(id: number){
let db = new Datastore({filename : 'ComerceDB'});
db.loadDatabase(() => {
db.remove({ _id: id }, {}, (err: any, numRemoved: any) => {
this.idHidden = true;
console.log(this.idHidden);
});
});
}
}