npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

ng2-component-popover

v1.0.4

Published

Angular2 component popover

Readme

ng2-component-popover

An angular2 custom component popover with a bootstrap3 implementation. Focus or click triggering along with programmatic triggering.

DEMO - https://plnkr.co/edit/jiVZozrHLIxmcwXWNOdx?p=preview

install package - npm i ng2-component-popover --save

systemjs

{
	"map": {
		'ng2-component-popover': 'npm:ng2-component-popover/bundles/ng2-component-popover.umd.js'
	}
}

usage


zi-popover - directive for marking an element as the target and assigning target a key

Basic example with programmatic trigger:

<div #target zi-popover="string.key3">
	<span>Target3</span>
</div>
import {
	PopoverService, PopoverEvent, Action, Location, ZIBootstrap3PopoverComponent,
	Bootstrap3Configuration
} from 'ng2-component-popover';

class ComponentOrServiceWithOpenCloseFunctions {

	constructor( private popoverService: PopoverService ) {}

	open() {
		let config = new Bootstrap3Configuration( 'string.key3', 'Popover Title', "Some content", Location.RIGHT, true, 5000 );
		this.popoverService.next( 'string.key3', new PopoverEvent( Action.OPEN, ZIBootstrap3PopoverComponent, config ) );
	}

	close() {
		this.popoverService.next( 'string.key3', new PopoverEvent( Action.CLOSE ) );
	}
}

Inputs:

[zi-popover-trigger]="triggerRef" - assign trigger to popover target for event triggering

triggerRef: Trigger = Trigger.CLICK;

Trigger Types

Trigger.CLICK
Trigger.FOCUSED

[zi-popover-configuration]="configurationRef" - assign configuration to popover target for describing default popover

configurationRef: PopoverConfiguration = new Bootstrap3Configuration( 'string.key3', 'Popover Title', "Popover content string", Location.LEFT, false, 5000 );

Locations

Location.TOP
Location.RIGHT
Location.BOTTOM
Location.LEFT

Bootstrap3Configuration constructor params:

  1. key - string: key of popover target
  2. title - string: title of popover
  3. content - string: content of popover
  4. location - Location: location of popover
  5. closer - boolean: should include close button in footer
  6. duration - number: milliseconds to show popover before closing

[zi-popover-ref]="popoverRef" - assign target a popover component refrence to use when triggered

Example:

<div #target zi-popover="key.123" [zi-popover-ref]="popoverRef">
	<span>Target</span>
</div>

<zi-bootstrap3-popover [target]="targetRef">
	<h3>Content that is projected into popover content</h3>
</zi-bootstrap3-popover>
@ViewChild( 'target' )
private targetRef: ElementRef;

@ViewChild( ZIBootstrap3PopoverComponent )
private popoverRef: ZIBootstrap3PopoverComponent;

zi-bootstrap3-popover component as bootstrap3 popover implementation with content projection

<zi-bootstrap3-popover [target]="targetRef">
	<span class="btn btn-default" (click)="alertConfig();">Alert Config</span>
</zi-bootstrap3-popover>

demo

demo app shows working click, focus and programmatic popovers as well as a custom hud extension

clone repo - git clone https://github.com/jcapozzi/ng2-component-popover.git

npm install - for developing on module

cd demo => npm install - install demo app

cd demo => npm run start - start demo app lite server

gulp install:demo - to install local changes to demo app instead of using npm published version