diff --git a/js/angular/service/actionSheet.js b/js/angular/service/actionSheet.js index 7129e01e80..f0aaa42129 100644 --- a/js/angular/service/actionSheet.js +++ b/js/angular/service/actionSheet.js @@ -87,6 +87,7 @@ function($rootScope, $compile, $animate, $timeout, $ionicTemplateLoader, $ionicP * Return true to close the action sheet, or false to keep it opened. * - `{boolean=}` `cancelOnStateChange` Whether to cancel the actionSheet when navigating * to a new state. Default true. + * - `{string}` `cssClass` The custom CSS class name. * * @returns {function} `hideSheet` A function which, when called, hides & cancels the action sheet. */ @@ -104,7 +105,7 @@ function($rootScope, $compile, $animate, $timeout, $ionicTemplateLoader, $ionicP // Compile the template - var element = scope.element = $compile('')(scope); + var element = scope.element = $compile('')(scope); // Grab the sheet element for animation var sheetEl = jqLite(element[0].querySelector('.action-sheet-wrapper')); diff --git a/test/unit/angular/service/actionSheet.unit.js b/test/unit/angular/service/actionSheet.unit.js index 606a1f4c38..2c0e33fd07 100644 --- a/test/unit/angular/service/actionSheet.unit.js +++ b/test/unit/angular/service/actionSheet.unit.js @@ -103,4 +103,12 @@ describe('Ionic ActionSheet Service', function() { expect(scope.cancel).not.toHaveBeenCalled(); })); + it('should add css class to element from cssClass option', inject(function($rootScope) { + var scope = setup({ + cssClass: 'custom-class' + }); + scope.showSheet(); + expect(scope.element.hasClass('custom-class')).toBe(true); + })); + });