If you want to have access to the id attribute of an element after an event, e.g. button click, you shall pass the $event variable and access the id property via the current target.

import {Component} from 'angular2/core';
  selector: 'my-app',
  template: `
    <button (click)="onClick($event)" id="test">Click</button>
export class AppComponent {
  onClick(event) {
    var target = event.target || event.srcElement || event.currentTarget;
    var idAttr = target.attributes.id;
    var value = idAttr.nodeValue;