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-simple-modal

v1.1.2

Published

Barebones, unopinionated modal service for angularjs 1.X written in ES2015

Downloads

1

Readme

#ng-simple-modal

This is an extremely simple modal service, written in ES2015 (ES6), allowing for creating and closing modal, with completely custom template, both from outside (controller with injected service) and inside (method exposed on modal's isolated scope). It has no dependencies outside of angular

######Currently it supports:

  • only one modal at a time
  • isolated scope on modal

##Install:
You can either download the repo, or use npm:

npm install --save ng-simple-modal

Just plug and play, really.

  • Add the file to your codebase
  • Put 'simple-modal' in your angular module dependencies
  • Inject modalService into your controller
  • ...
  • Profit!

##Usage:
Service exposes two methods: open() and close() which do what says on the can. Calling close() before open() will throw a Error - so don't do that.

The open() method accepts a configuration object with following properties:

  • template - HTML string being the template for the modal (bear in mind, that modal itself does not provide anything, not even background-color)
  • scope - object literal containing things you'd like to put on modal's isolated scope
  • backdropClosing - (defaults: true) boolean indicating whether clicking on backdrop should close the modal
  • onClose - function which will be ran each time modal closes (both from backdrop or service)
  • controller - controller function for modal contents

Also on the modal's scope is exposed API in the form of closeModal() method allowing you to attach it to your cancel button (the closeModal method exposed will take into account onClose method passed in open).

##Declaration of Compliance to SemVer:
For what it's worth I'd like to promise here that I will strictly respect Semantic Versioning
understood as follows:

  • all bugs, fixes and minor changes of any kind will increment last digit (path)
  • all additive, but non-breaking changes of any kind will increment middle digit (minor)
  • any and all breaking changes of any significance will increment first digit (major)
    I have no problem whatsoever with having for instance version 35.12.178 as long as it stays meaningful.

##Contribs, feature requests, PRs etc.
It's my first ever OSS work, so i haven't figured out how to deal with such things yet. But i really do appreciate any feedback, so open issues, message me and so forth; i'd be happy to make this a useful lib for many people.

##License
MIT

##Credits
I'd like to give my thanks to icebox from #angularjs for help in putting this together and lots of good advice!