diff --git a/js/angular/service/popup.js b/js/angular/service/popup.js
index 80f04cbb22..1f98b44cd1 100644
--- a/js/angular/service/popup.js
+++ b/js/angular/service/popup.js
@@ -1,6 +1,6 @@
var POPUP_TPL =
- '
' +
+ '
' +
'
' +
'
' +
'' +
@@ -138,6 +138,7 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
* ```
* {
* title: '', // String. The title of the popup.
+ * class: '', // String, The custom CSS class name
* subTitle: '', // String (optional). The sub-title of the popup.
* template: '', // String (optional). The html template to place in the popup body.
* templateUrl: '', // String (optional). The URL of an html template to place in the popup body.
@@ -176,6 +177,7 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
* ```
* {
* title: '', // String. The title of the popup.
+ * class: '', // String, The custom CSS class name
* subTitle: '', // String (optional). The sub-title of the popup.
* template: '', // String (optional). The html template to place in the popup body.
* templateUrl: '', // String (optional). The URL of an html template to place in the popup body.
@@ -204,6 +206,7 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
* ```
* {
* title: '', // String. The title of the popup.
+ * class: '', // String, The custom CSS class name
* subTitle: '', // String (optional). The sub-title of the popup.
* template: '', // String (optional). The html template to place in the popup body.
* templateUrl: '', // String (optional). The URL of an html template to place in the popup body.
@@ -242,6 +245,7 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
* ```
* {
* title: '', // String. The title of the popup.
+ * class: '', // String, The custom CSS class name
* subTitle: '', // String (optional). The sub-title of the popup.
* template: '', // String (optional). The html template to place in the popup body.
* templateUrl: '', // String (optional). The URL of an html template to place in the popup body.
@@ -306,6 +310,7 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
title: options.title,
buttons: options.buttons,
subTitle: options.subTitle,
+ class: options.class,
$buttonTapped: function(button, event) {
var result = (button.onTap || angular.noop)(event);
event = event.originalEvent || event; //jquery events
diff --git a/test/unit/angular/service/popup.unit.js b/test/unit/angular/service/popup.unit.js
index d533752ff5..9e306fb24f 100644
--- a/test/unit/angular/service/popup.unit.js
+++ b/test/unit/angular/service/popup.unit.js
@@ -52,6 +52,13 @@ describe('$ionicPopup service', function() {
var popupBody = popup.element[0].querySelector('.popup-body');
expect(popupBody).toBe(null);
});
+ it('should set the specified custom CSS class to popup container', function() {
+ var popup = TestUtil.unwrapPromise($ionicPopup._createPopup({
+ template: 'Hello, friend!',
+ class: 'mycustomclass'
+ }));
+ expect(popup.element.hasClass('mycustomclass')).toBe(true);
+ });
describe('$buttonTapped', function() {
var popup;