I have a component called "modal-form" and another called "array" and I would like to update the array after the submit of the form without refresh the view. I tried to use @Input but it didn't seem to work when I called a test function from modal component.
modal-form
Here I post the form but I refresh the view, this is not what I'm looking for.
add() {
this.service.post(this.form).subscribe((data) => {
console.log(data)
this.router.navigate([this.router.url]);
});
}
array
ngOnInit(): void {
this.service.getObjects().subscribe((data) => {
this.objects = data;
});
}