Fork me on GitHub

VD modal

Easy to use angularJS modal.

Star Fork

Hello world, this is my very first VD modal.

Click anywhere outside to close it.

Hello world!

This is my first modal using VD modal

Content always centered using flexbox.

Mister Penguin

3 weeks ago

Great day with my fellows!

Install and configure in 4 steps.

1. Install it from npm.

$ npm install --save vd-modal

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.

				
"use strict"

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

4. Create your modal.

> my-application.js

				
"use strict"

(function(){
	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;
		}
	});
})();
							
			

> my-application.html (inside body excerpt)

			
				
<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>
				
			
Voilá! You will have a modal just like this.