What I'm using
- Angular
What I'm trying to do
- I have a list. When I hit a button, I want to append some custom attributes to a certain HTML element
What I have
My HTML List
A button hooked up to a click event
What I'm not sure how to do
- When I click the button the follow attributes are added to my 'container' div:
[phantomOp]="myItems" [myOper]="oper"
HTML
<div class="container">
<ul>
<li> Albums </li>
<li> Dates </li>
</ul>
</div>
<button (click)="addContainerAttributes"> Add Container Attributes </button>
What I would like the HTML to look like after a button click
<div class="container" [phantomOp]="myItems" [myOper]="oper">
<ul>
<li> Albums </li>
<li> Dates </li>
</ul>
</div>
TS
addContainerAttributes(){
// Not entirely sure what to put here
}