Skip to content

Instantly share code, notes, and snippets.

@aleixsuau
Last active March 15, 2019 16:57
Show Gist options
  • Save aleixsuau/75135d946c64627f11ca8090798cf6ad to your computer and use it in GitHub Desktop.
Save aleixsuau/75135d946c64627f11ca8090798cf6ad to your computer and use it in GitHub Desktop.
@Component({
selector: 'app-help-hint-dynamic',
templateUrl: `
<div class="help-hint-container">
<div *ngTemplateOutlet="templateRef"></div>
<img src="https://cdn.onlinewebfonts.com/svg/img_28550.png"
[title]="hint"
(mouseover)="onMouseOver();"
*ngIf="hint">
</div>`,
styleUrls: ['./help-hint-dynamic.component.css']
})
export class HelpHintDynamicComponent {
@Input()
hint: string;
@Input()
templateRef: TemplateRef<any>;
@Output()
helpHovered = new EventEmitter<void>();
onMouseOver() {
this.helpHovered.emit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment