angular2-draggable
angular2-draggable copied to clipboard
Bounds element from different component
If I set an element from different component to bounds, it doesn't work. Any ideas how to deal with it?
same problem here, I tried with a DIV id but it doesn't work
found the solution ! Here is your parent component :
<div #mainDiv>
<childComponent [parentContainer]="mainDiv"></childComponent>
</div>
And your child component :
<div ngDraggable [bounds]="parentContainer" [inBounds]="true"> yeah </div>
export class ChildComponent implements OnInit {
@Input() parentContainer: ElementRef;
constructor() { }
ngOnInit() {}
}