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

angularpopservice

v1.0.3

Published

Angular PopService is providing custom Bootstrap Modal Service in Angular -- supports creating popups and modals via a service. See [a quick plunker](https://plnkr.co/edit/MGjQAhmnGA8Q1RjTilRE?p=preview) or a full set of samples at [https://github.com/GRa

Downloads

18

Readme

angularPopService

Angular PopService is providing custom Bootstrap Modal Service in Angular -- supports creating popups and modals via a service. See a quick plunker or a full set of samples at https://github.com/GRajaMca/angularpopservice/.

  1. Usage
  2. Developing
  3. Note
  4. Thanks
  5. Contact

Usage

Install with Bower (or NPM):

bower install angularpopservice
# or...
npm install angularpopservice

Then reference the minified script:

<script src="bower_components/angularpopservice/dist/angularpopservice.min.js"></script>

Developing

Specify the angularPopService as a dependency of your application:

angular.module('imgui', [ 'angularPopService' ]).controller('mainCtrl',
		MainCtrl);

MainCtrl.$inject = [ '$scope', '$rootScope', 'popService' ];

Now just inject the angularPopService into any controller, service or directive where you need it.

function MainCtrl($scope, $rootScope, popService) {

  //$scope.alert function is used provide simple bootstrap alert
 	$scope.alert = function() {
    //popService is the service provider of angularPopService
    //popService.showModal("Title","content","optional","optional","templateUrl")
		popService.showModal("Alert",
				"This is simple Alert message", "", "",
				"sample/popup/alert.html").then(function(data) {
		});
	};
  

};

angularPopService is Customized Bootstrap Modal,it works everything as JSON and templateUrl what you are going to provide

Now This sample is used to provide warning message to the end user and get the response from user,if the user said yes it will go to next step else break the process

<!--Template Url-->
<div class="modal fade">
  <div class="modal-dialog modal-md">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">{{title}}</h4>
      </div>
      <div class="modal-body">
        <p>{{warning}}</p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="close()">OK</button>
      </div>
    </div>
  </div>
</div>
//$scope.warning function is used to provide warning message
$scope.Warning = function() {
//popService.showModal("title","message","optional","optional","templateUrl");
//for templateUrl checkout our sample and use the same format of close the window and buttons
popService.showModal("Warning",
		"Are you Sure do you want to Process ??", "", "",
		"sample/popup/warning.html").then(function(data) {
		//data is the response from angularPopService
		if (angular.isDefined(data.action)) {
		var temp = "Not Process";
		//if the response is true then it will move further else break
		if (angular.equals(data.action, true)) {
		var temp = "Process";
		}
		$scope.warningMessage = "You Said to " + temp;
		}
	});
};
	

Sample for Complex Modal, Get the input from angularPopService

<!--Template samle -->
<div class="modal fade">
	<div class="modal-dialog modal-md">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" ng-click="close()"
					data-dismiss="modal" aria-hidden="true">&times;</button>
				<h4 class="modal-title">{{title}}</h4>
			</div>
			<div class="modal-body">
				<div class="form-group">
					<!--get all the input object start with data.yourObjectName --> 
					<label class="control-label"> User Name</label>
					<input type="text" class="form-control" ng-model="data.username" placeholder="UserName">
					<label class="control-label">Password</label>
					<input type="password" class="form-control" ng-model="data.password" placeholder="Password">
				</div>

			</div>
			<div class="modal-footer">
				<button type="button" ng-click="close(false)"
					class="btn btn-default" data-dismiss="modal">No</button>
				<button type="button" ng-click="close(true)" class="btn btn-primary"
					data-dismiss="modal">Yes</button>
			</div>
		</div>
	</div>
</div>

$scope.Complex = function() {
	//popService.showModal("title","optional","optional","optional","templateUrl")
	popService.showModal("Complex", "", "", "", "sample/popup/complex.html")
		.then(function(data) {
			//data is the response from angularPopService
			if (angular.isDefined(data.action) && angular.equals(data.action,true)) {
			//data.data is value which you have given in Modal view
			var userInput = data.data;
			$scope.ComplexObj = "You Have Entered "+ ",UserName ->"+ userInput.username+ " ,Password ->"+userInput.password;
			}
		});
};

Sample for Posting the data from Controller to Modal View

<!--Template url for Posting the data -->
<div class="modal fade">
  <div class="modal-dialog modal-md">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">{{title}}</h4>
      </div>
      <div class="modal-body">
      	<!--All your data passing from Controller you will receieve on object body in the modal view -->
        <p>{{warning}} {{body.name}}</p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary" data-dismiss="modal" ng-click="close()">OK</button>
      </div>
    </div>
  </div>
</div>
//sample for posting data from controller to Modal View

$scope.postData = function(data) {
	//popService.showModal("Title","message","Object or data passing the Modal","optional","templateUrl")
	popService.showModal("Posting the Data", "Your Name is ", data, "",
		"sample/popup/postData.html").then(function(data) {
			//data is the response from angularPopService
		});
	};

Note

Try to use the angularPopService in sample how we provided,if you are passing the data or Object to the Modal view use 3rd parameter of popService.showModal function,and you will get the data into the body object in Modal View

If you are collecting input from Modal View bind the object to data and collect you will be receive the data in controller in the object of data.data,

Check out the above sample for your use..

Thanks

The special Thanks to angular modal service,this is inspired from angular modal service

Contact

Reach me on (https://www.linkedin.com/in/graja-mca-15445286/)