Angular function 2 similar to Toggle Jquery

Asked

Viewed 81 times

-2

I need to do something similar to jQuery’s toggle on a FAQ page.
If the user clicks on the question then display the answer below, in case they click again to hide.. However, we are using angular 2 and I saw that there are several classes/functions that deal with animations, but I couldn’t understand/implement I found any example that does this...(I’m beginner in angular..)
An example site that implements toggle: http://www.maujor.com/blog/pg_apoio/jquery-toggle-texto-exemplo.html

Could someone help me by implementing an example of toggle using angular 2? (https://angular.io/api )

1 answer

0

Why not use the simple, only with HTML 5?

<details>
  <summary>Em que site estou?</summary>
  <p>Está no Stack Overflow em Português</p>
</details>

  • 1

    Nice this tag, I didn’t know it. Simple and easy, but with a however, always have to right? IE it doesn’t work, has no support in any version. :/

  • Well observed. I had forgotten to look at the "can i use".

Browser other questions tagged

You are not signed in. Login or sign up in order to post.