Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ng2-window-view

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng2-window-view

[![NPM](https://nodei.co/npm/ng2-window-view.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/ng2-window-view/) [![NPM](https://nodei.co/npm-dl/ng2-window-view.png?months=3&height=3)](https://nodei.co/npm/ng2-window-view/)

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ng2-window-view

NPM NPM

Documentation & Example Here!

Concept

A few of core class for implement window more convenient, and provide collection of common type of modal, dialog components.

Core Classes

  • WindowViewContainerComponent - A window component using bootstrap panel class. Anything wrap by this will present as content of a window. Provide some common config.

  • WindowViewOutletComponent - An outlet component similar to router-outlet. Require WindowViewService, any window push from WindowViewService will be placed after outlet component.

  • WindowViewService - For management of windows. It treat all windows as a stack. You can push or pop window from it.

  • WindowViewLayerService - Some case, you need multi-floating window feature, that is what WindowViewLayerService do. If a WindowViewContainerComponent enable floating and disable showBackground, it will be push into WindowViewLayerService. All windows in WindowViewLayerService can change z-index by clicking component.

Components

  • ConfirmDialog

Usage

$ npm install --save ng2-window-view

Quick Start

  1. Import module.
import { NgModule } from '@angular/core';
import { WindowViewModule } from 'ng2-window-view';
import { MyWindowComponent } from './my-window-component';

@NgModule({
  imports: [
    WindowViewModule
  ],
  entryComponents: [
    // window component have to provide a component factory,
    // by adding component to `entryComponents`.
    MyWindowComponent
  ]
})
export class AppModule {}
  1. Create your window component.
import { Component } from '@angular/core';
import { WindowViewContainerComponent } from 'ng2-window-view';

@Component({
  selector: 'my-window',
  template: `
  <window-view-container [heading]="windowTitle">
    It's a window!!
  </window-view-container>`
})
export class MyWindowComponent {
  windowTitle: string = 'Title here!';
}
  1. Push window component.
import { Component, ComponentRef } from '@angular/core';
import { WindowViewOutletComponent, WindowViewService } from 'ng2-window-view';
import { MyWindowComponent } from './my-window';

@Component({
  selector: 'app-root',
  template: `
  <button (click)="openWindow()">Open Window</button>
  <window-view-outlet></window-view-outlet>
  `,
  providers: [WindowViewService]
})
export class AppComponent {
  constructor(private windowView: WindowViewService) {}
  
  openWindow() {
    this.windowView.pushWindow(MyWindowComponent);
  }
}

Keywords

FAQs

Package last updated on 01 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc