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 🙏

© 2024 – Pkg Stats / Ryan Hefner

ng-mat-interactions-dialog

v2.0.0

Published

Create modal dialogs for Alert, Prompt, and Confirm using Angular Material Dialogs by simply calling the service method ( no need to create your own templates manage styles etc).<br>Use default templates or optionally pass a title, message text, button te

Downloads

2

Readme

NgMatInteractionsDialog

Description:

Create modal dialogs for Alert, Prompt, and Confirm using Angular Material Dialogs by simply calling the service method ( no need to create your own templates manage styles etc).Use default templates or optionally pass a title, message text, button text, an/or a template reference. This is an Angular component/service module library requiring an Angular application. This was generated and tested in Angular CLI version 7.2.0.

Get Started:

Requires an existing Angular application or create one:

So, inside your Angular application directory:

install library

use your preferred import method:

NPM:

YARN:

install peer dependencies as needed:

Angular Material

Aside from core Angular modules for any new angular project ( @angular/core, @angular/common, @angular/forms ), this library has also peer dependencies for Angular Material (https://material.angular.io/guide/getting-started) Follow get started steps 1-2, 4: install npm modules, import animations module, include a theme.

...from https://material.angular.io/guide/getting-started

  1. install angular material
  1. import browser animations module ( in app module or)
  1. the library imports the material component modules it needs already, as long as you have them installed
  2. import a theme example:

in the test version I use the theme builder with some custom overrides: projects/ng-mat-tester/src/assets/styles/material/material-theme.scss projects/ng-mat-tester/src/assets/styles/material/material-overrides.scss 5. Gesture (hammer.js) support is not necessarily required for this library. This project uses Angular Material's MatButton, MatDialog, and MatInput component modules.

in projects/ng-mat-tester/src/styles.scss:

Usage

Parent Module:

Component or Service:

then (same component/service): alert(), confirm(), and prompt() service methods return an observable for that dialog's close event

or

or

options: DialogData

To use the template feature, pass a template reference from the relevant component: ElementRef;

in component.html:

  <ng-template #myAlertContentTemplate>
    <ul>
      <li>Step One</li>
      <li>Step Two</li>
      <li>Step Three</li>
    </ul>
  </ng-template>

in component.ts:

Development

The Development repo is available @ https://github.com/t0johnso/ng-mat-interactions-dialog

projects > ng-mat-interactions-dialog is the actual library projects > ng-mat-tester is a test environment you can use to test locally before repackaging;

Serve

See a sample app running the build

Test library

Test consumer application:

Build and Serve:

This will, build the library, packaged as dist/ng-mat-interactions-dialog/ng-mat-interactions-dialog-version#.tgz, and serve the test application (on localhost:4200).

Test your package

You'll want to serve up a new app and test importing you new version of the package Todd Palmer wrote a great article on this for Angular-In-Depth, Bookmarked that section of the article here: https://blog.angularindepth.com/creating-a-library-in-angular-6-part-2-6e2bc1e14121#1cb3