Answer the question
In order to leave comments, you need to log in
Angular 2. How to select markup inside ng-content?
I am making a universal component that will catch drag-n-drop files
I want to hang event processing on the content that will be inside
ng-content
@Component({
selector: 'drop-area',
template: '<ng-content></ng-content>'
})
export class DropAreaComponent
{
@Output('file') fileEvent: EventEmitter<File> = new EventEmitter<File>();
@Output('hover-drag') hoverEvent: EventEmitter<boolean> = new EventEmitter<boolean>();
constructor() {
}
}
<drop-area file="fileChange()" hover-drag="dragArea()">
<div id="target"></div>
</drop-area>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question