WindowService

A service for opening Windows dynamically
(see example).

Constructors

WindowService (resolver: ComponentFactoryResolver, containerService: WindowContainerService)

Parameters

resolver ComponentFactoryResolver
containerService WindowContainerService

Methods

open

Opens a Window component.

@Component({
  selector: 'my-app',
  template: `
    <button kendoButton (click)="open()">Open window</button>
    <div kendoWindowContainer></div>
  `
})
export class AppComponent {
    constructor( private windowService: WindowService ) {}

    public open() {
        var window = this.windowService.open({
          title: "My window",
          content: "My content!"
        });

        window.result.subscribe((result) => {
          if (result instanceof WindowCloseResult) {
            console.log("Window was closed");
          }
        });
    }
}

Parameters

settings WindowSettings

The settings that define the Window.

Returns

WindowRef - A reference to the Window object.