I have the following:
...
<div class="container">
<div class="fancy">
<fancybutton></fancybutton>
</div>
<button (click)="addAttribute()">Remove</button>
<button (click)="remAttribute()">Add</button>
</div>
... My question is, How can I make it so that when the user hits "addAttribute()" it adds "testattribute" to the parent dom element of the component like this:
<div class="fancy" testattribute="a">
<fancybutton></fancybutton>
</div>
This is my fancy-button component, below is the parent template that i have the fancy-button integrated in within the home.component.html:
@Component({
selector: 'fancy-button',
template: `<button>clickme</button>`
})
export class FancyButton {}
@Component({
selector: 'home', // <home></home>
providers: [
Title
],
styleUrls: [ './home.component.css' ],
templateUrl: './home.component.html'
})