1

I am using ng-bootstrap' modal and got stuck with a problem.
Situation:- I have a form component that I am showing in a modal. Now, I want to close the modal once the user submits the form and backend confirms the success.
problem:- As guided here, I don't have a reference of the modal in child component to close it. please suggest a way. Thanks.

1
  • Duplicate of this SO question. Commented Jun 25, 2018 at 3:56

1 Answer 1

4

You could pass the modal reference to it using a child input property.

<child-component [parentRef]="ref"> 

And then in your child component you'll have to define something like:

@Input() ref; 

Please take a look at the Angular documentation here.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.