Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(card): make md-card themeable
Browse files Browse the repository at this point in the history
Closes #619.
  • Loading branch information
mzbyszynski authored and ajoslin committed Nov 16, 2014
1 parent e59a36f commit 55cdb5b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/card/card.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ angular.module('material.components.card', [
* </hljs>
*
*/
function mdCardDirective() {
function mdCardDirective($mdTheming) {
return {
restrict: 'E',
link: function($scope, $element, $attr) {
$mdTheming($element);
}
};
}
Expand Down
14 changes: 14 additions & 0 deletions src/components/card/card.spec.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
describe('mdCard directive', function() {

beforeEach(module('material.components.card'));

it('should have the default theme class when the md-theme attribute is not defined', inject(function($compile, $rootScope) {
var card = $compile('<md-card></md-card>')($rootScope.$new());
$rootScope.$apply();
expect(card.hasClass('md-default-theme')).toBe(true);
}));

it('should have the correct theme class when the md-theme attribute is defined', inject(function($compile, $rootScope) {
var card = $compile('<md-card md-theme="green"></md-card>')($rootScope.$new());
$rootScope.$apply();
expect(card.hasClass('md-green-theme')).toBe(true);
}));
});

0 comments on commit 55cdb5b

Please sign in to comment.