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

vd-modal

v0.0.2

Published

vd-modal is a easy to use modal for angularjs application. one modal at a time.

Downloads

5

Readme

VD Modal

VD Modal is a easy to use modal for angularjs application. one modal at a time.

vd modal easy to use angularjs modal one modal at a time

This is another modal component using angularJs framework. This modal wants to be simple and easy to use.

  • VD Modal opens one modal at a time, never shows two modals at same time.
  • All your modal content is only attached to your document after modal popups, it means your modal **will not ** be hidden using css display: none or angular ng-show features. And this can be good to your SEO.
  • VD Modal was made with love by Viva Decora front end team.

Table of contents

1. Install VD modal as a npm package:

$ npm install --save vd-modal

Or use it from unpackage cdn, from this url:

https://unpkg.com/[email protected]/dist/js/vd-modal.min.js

2. Insert javascript and css from vd-modal.

<script src="/path/to/vd-modal/dist/js/vd-modal.min.js" type="application/javascript"></script>
<link rel="stylesheet" href="/path/to/vd-modal/dist/css/vd-modal.css">

3. Inject vd-modal module to your application.


(function(){
    "use strict"
	
	angular.module("my-application", ["vd-modal"]);
})();

Create your modal by using ModalModel factory. ModalModal provides a function called getContructor(nameOfYourModal) that you can use to create new instances of your modals, like that:


(function(){
   "use strict"
       
	angular.module("my-application").controller("mainController", function(ModalModel){
		var vc = this;
		vc.helloWorlModal = new ModalModel.getConstructor("hello-world");
		vc.openHelloWorlModal = function(){
			vc.helloWorlModal.isOpen = true;
		}
	});
})();	

After you do id, create your own <modal> in html wrapping any content you need:

<body ng-app="my-application">
	<modal model="vc.helloWorlModal">
		<h1>Hello world!</h1>
		<p> This is my first modal using VD modal </p>
	</modal>
	<main ng-controller="mainController">
		<button ng-click="vc.openHelloWorlModal()"></button>
	</main>
</body>	

Column modal is another directive you are able to use to create a two columns modal. Modals with columns have basically

  • A column for main content;
  • A column for sidebar content;
  • A toggle button inside content column to expand/collapse sidebar;

Create your instance of ModalModel as usually:


angular.module("my-application").controller("MainController", MainController);

function MainController(ModalModel){

    var vc = this;
    vc.sidebarModel = new ModalModel.getConstructor("sidebar-model");
    vc.sidebarModel.isFullscreen = true;

    vc.openSidebarModel = function(){
        vc.sidebarModel.isOpen = true;
    }
}

and in your HTML you should do:


<modal model="vc.sidebarModel">
    <div class="vd-modal__grid">
        <modal-column layout="content" modal-instance="sidebar-model">Content of my modal</modal-column>
        <modal-column layout="sidebar" modal-instance="sidebar-model">Sidebar of my modal</modal-column>
    </div>
<modal>

<button ng-click="vc.openSidebarModal()">Open sidebar modal</button>

VD modal is licensed under MIT. [https://github.com/vivadecora/vd-modal/blob/master/LICENSE](see more).