src/placeholder/placeholder.component.ts
Using a modal, dialog (Tooltip, OverflowMenu), or any other component that draws out of the normal page flow
in your application requires this component (ibm-placeholder
).
It would generally be placed near the end of your root app component template
(app.component.ts or app.component.html) as:
* <ibm-placeholder></ibm-placeholder>
*
selector | ibm-placeholder |
template |
|
Properties |
Methods |
constructor(placeholderService: PlaceholderService)
|
||||||
Defined in src/placeholder/placeholder.component.ts:27
|
||||||
Creates an instance of
Parameters :
|
ngOnInit |
ngOnInit()
|
Defined in src/placeholder/placeholder.component.ts:37
|
Registers the components view with
Returns :
void
|
Public placeholderService |
placeholderService:
|
Type : PlaceholderService
|
Defined in src/placeholder/placeholder.component.ts:32
|
viewContainerRef |
viewContainerRef:
|
Type : ViewContainerRef
|
Decorators :
@ViewChild('placeholder', {read: ViewContainerRef})
|
Defined in src/placeholder/placeholder.component.ts:27
|
Maintains a reference to the view DOM element of the |
import {
Component,
OnInit,
ViewContainerRef,
ViewChild
} from "@angular/core";
import { PlaceholderService } from "./placeholder.service";
/**
* Using a modal, dialog (Tooltip, OverflowMenu), or any other component that draws out of the normal page flow
* in your application *requires* this component (`ibm-placeholder`).
* It would generally be placed near the end of your root app component template
* (app.component.ts or app.component.html) as:
*
* ```
* <ibm-placeholder></ibm-placeholder>
* ```
*/
@Component({
selector: "ibm-placeholder",
template: `<div #placeholder></div>`
})
export class Placeholder implements OnInit {
/**
* Maintains a reference to the view DOM element of the `Placeholder`.
*/
@ViewChild("placeholder", { read: ViewContainerRef }) viewContainerRef: ViewContainerRef;
/**
* Creates an instance of `Placeholder`.
*/
constructor(public placeholderService: PlaceholderService) { }
/**
* Registers the components view with `PlaceholderService`
*/
ngOnInit() {
this.placeholderService.registerViewContainerRef(this.viewContainerRef);
}
}