PopEye | A simple modal library for AngularJS applications

Popeye angular module

popeye

Stars : 10

Forks : 10

Created by Pathgather

bower install angular-popeye

Demo Download GitHub

Most modal libraries for Angular are either frustratingly complicated or annoyingly dependent on a ton of external stuff. Popeye is simple, self-contained, and just “pops up” when you need it to.

Inject the Popeye service to open a modal and pass along your options:
var modal = Popeye.openModal(...);

The modal object returned is open and flexible. It has resolved, opened, and closed promises you can use to listen to the modal state, and exposes the scope and controller so you can interact with them:

mod.controller("myCtrl", function($scope, Popeye) {

$scope.openUserProfile = function(userId) {

// Open a modal to show the selected user profile
var modal = Popeye.openModal({
templateUrl: "my_modal_template.html",
controller: "myModalCtrl as ctrl",
resolve: {
user: function($http) {
return $http.get("/users/" + userId);
}
}
});

// Show a spinner while modal is resolving dependencies
$scope.showLoading = true;
modal.resolved.then(function() {
$scope.showLoading = false;
});

// Update user after modal is closed
modal.closed.then(function() {
$scope.updateUser();
});
};

});

npm bower build dependencies devDependencies

Popeye

A simple modal library for AngularJS applications.

Documentation

See the demo page for installation instructions, usage, and documentation.

Javscript

Javascript plugin

Angular-js