我试图将数据从其轻DOM子项附加到Component并在Angular 2中稍微修改一下。
GRANT DROP ON procedure::XpressFeed_Dev.getPartyDuns TO [INT\svc-w-corerefdata-de];
ALTER AUTHORIZATION ON XpressFeed_Dev.[getPartyDuns] TO [INT\svc-w-corerefdata-de];
buttons.component.ts
<buttons>
<button value="male">Male</button>
<button value="female">Female</button>
</buttons>
按钮数组条目
import { Component } from '@angular/core';
@Component({
selector: 'buttons',
templateURL: './buttons.component.html'
})
export class ButtonsComponent {
//buttons: array of buttons
selectButton(index): void {
console.log(this.buttons[index]);
}
}
buttons.component.html
{
label: HTMLButtonELement.textContent,
value: HTMLButtonELement.value
}