10

I have a form with a id :

<form id="dummyForm">
    <input type="text">
    <input type="submit" value="click me">
</form>

and a div with data attribute, which contains form's id :

<div attr.data-form-id="dummyForm" (click)=hideForm()>Click to hide</div>

how can I get the data-form-id value in hideform() function. so that I can hide the form.

Any Help?

1 Answer 1

16
<div attr.data-form-id="dummyForm" 
    #me 
    (click)="hideForm(me.getAttribute('data-form-id'))">
  Click to hide
</div>
Sign up to request clarification or add additional context in comments.

1 Comment

That was the plan :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.