samedi 19 novembre 2016

Angular 2/Typescript: Get value from [object Object]

I have an angular 2 web application that fires some events. On of the properties of event.target.parentNode looks like this. The nodeValue and value show [object Object]. How can I get the actual content of this object?

enter image description here

Edited to add code:

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>




Aucun commentaire:

Enregistrer un commentaire