How do I control whether a HTML5 details tag is open or not with Angular

The HTML details tag is a collapsible chunk of content. You declare a closed (collapsed) details tag by writing

<details>Some stuff</details>

And an open (expanded) one by writing

<details open>Some stuff</details>

How do we dynamically add and remove attributes from a tag (in this case specifically the open attribute) with Angular?

Given that the <details> tag is not supported in many browsers you might want to consider using something else instead. This link shows how you can create an equivalent to the <details> tag which will work in all major browsers.

But otherwise, as @Tim Withers states, you should look to build a directive that will allow you to change this. Specifics depend on exactly how and when you are expecting to add/remove the attribute.

You just need to use ngOpen like so:

<details ng-open="boolean">