I am currently utilizing Angular 4
. I need to invoke methods from a typescript file within the ngAfterViewInit
method.
declare var $;
@Component({
selector: 'app-details',
templateUrl: './details.component.html',
styleUrls: ['./details.component.css']
})
export class DetailsComponent implements OnInit ,AfterViewInit{
ngAfterViewInit(): void {
$(document).on("hide.bs.modal", function () {
//this.setValueInsideDetailForm(); This is methods inside typescript file, which I want to call.
});
}
setValueInsideDetailForm(){
// Some code here.
}
}
Unfortunately, it results in an error stating that setValueInsideDetailForm
is undefined.