Skip to content

Commit c9ba97f

Browse files
committed
fix ripple on button and show custom class
1 parent ca71f6c commit c9ba97f

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<button class="mdc-button mdc-button--raised">Example Button</button>
1+
<button class="my-button mdc-button mdc-button--raised">Example Button</button>
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
@import "@material/ripple/mdc-ripple";
22
@import "@material/button/mdc-button";
3+
4+
.my-button {
5+
@include mdc-button-container-fill-color(blue);
6+
}

src/app/custom-button/custom-button.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class CustomButtonComponent implements AfterViewInit, OnDestroy {
1313
constructor(public myElement: ElementRef) { }
1414

1515
ngAfterViewInit() {
16-
this.ripple = new MDCRipple(this.myElement.nativeElement);
16+
this.ripple = new MDCRipple(this.myElement.nativeElement.querySelector('.mdc-button'));
1717
}
1818

1919
ngOnDestroy() {

0 commit comments

Comments
 (0)