neokoenig / jQuery-gridmanager

A way of building rows and grids with built in editable regions; requires jQuery, jQueryUI, Bootstrap 3.x, & optional TinyMCE or CKEditor
http://neokoenig.github.io/jQuery-gridmanager/
461 stars 129 forks source link

How get a value of id from template of another Component angular2 #88

Open khalildiouriadservio opened 8 years ago

khalildiouriadservio commented 8 years ago

I need to get an ID of a tag

from another Component template
  <li id="form" (onDragStart)="getDraggableId($event)">Form</li>
in typescript file(component) I have this

 getDraggableId(event) {
        this.gridService.setDraggabledIdGrid(event.mouseEvent.target.id);
        console.log("event  " + this.gridService.getDraggabledIdGrid());

    }

how can I get event.mouseEvent.target.id

I tried to create a service gridService to intermediate between the two components

@Injectable()
export class gridService {
    draggableIdGrid:string;

    constructor() {

    }
    getDraggabledIdGrid():string{
        return this.draggableIdGrid;
    }
    setDraggabledIdGrid(value){
        this.draggableIdGrid = value;
    }
}

but when I call the method getDraggableIdGrid I get undefuned value

neokoenig commented 8 years ago

Sorry, I have zero experience with Angular.