-<span class="material-icons" placement="{{placement}}" *ngIf="helpLink.length < 1; else withUrl" ngbPopover="{{helpText}}" triggers="keyup.enter click" tabindex="0">live_help</span>
-<ng-template #withUrl>
- <ng-template #popContent>
- <a target="_blank" href="{{helpLink}}">{{helpText}}</a>
- </ng-template>
- <span class="material-icons" [ngbPopover]="popContent" placement="{{placement}}" triggers="keyup.enter click" tabindex="0">live_help</span>
+<ng-template #popContent>
+ <a target="_blank" href="{{helpLink}}" *ngIf="helpLink.length >= 1">{{helpText}}</a>
+ <span *ngIf="helpLink.length < 1">{{helpText}}</span>
</ng-template>
+<button class="btn btn-sm" placement="{{placement}}" [ngbPopover]="popContent" triggers="click"i
+ i18n-aria-label aria-label="Show help" aria-haspopup="true">
+ <span class="material-icons" i18n-aria-label aria-label="Show help">live_help</span>
+</button>
import {NgbPopover} from '@ng-bootstrap/ng-bootstrap';
@Component({
- selector: 'eg-help-popover',
- templateUrl: './eg-help-popover.component.html',
- styleUrls: ['./eg-help-popover.component.css']
+ selector: 'eg-help-popover',
+ templateUrl: './eg-help-popover.component.html',
+ styleUrls: ['./eg-help-popover.component.css']
})
export class EgHelpPopoverComponent implements OnInit {
- @Input()
- helpText = '';
+ // The text to display in the popover
+ @Input()
+ helpText = '';
- @Input()
- helpLink = '';
+ // An optional link to include in the popover. If supplied,
+ // the entire helpText is wrapped in it
+ @Input()
+ helpLink = '';
- @Input()
- placement = '';
+ // placement value passed to ngbPopover that controls
+ // where the popover is displayed. Values include
+ // 'auto', 'right', 'left', 'top-left', 'bottom-right',
+ // 'top', and so forth.
+ @Input()
+ placement = '';
- constructor() { }
+ constructor() { }
- ngOnInit() {
- }
+ ngOnInit() {
+ }
}