Angular 2 / Typescript:从[object Object]获取值

时间:2016-11-19 12:28:21

标签: angular typescript reflection typescript2.0

我有一个角度2 Web应用程序可以触发某些事件。关于event.target.parentNode的属性如下所示。 nodeValue和value显示[object Object]。如何获取此对象的实际内容?

enter image description here

编辑添加代码:



pressed(event, item: someItem) {
        console.log(event);
  console.log(event.target.parentNode.attributes[1].value);
        console.log("pressed");
    }

<div class="grid" [ngGrid]="{'max_cols': 3, 'auto_resize': true}">
        <sticky-note *ngFor="let item of items"
                     [stickyNote]="sNotes" class="grid-item" [(ngGridItem)]='item.config'
                     (onDragStop)="dragged(item)"  (press)="pressed($event, item)" (pressup)="pressedup($event, item)" #gItem> </sticky-note>
      
    </div>
&#13;
&#13;
&#13;

0 个答案:

没有答案
相关问题