Permalink
Browse files

Include MDL JS in DashboardComponent

  • Loading branch information...
dawneraq committed Apr 25, 2017
1 parent c8eac0b commit 6ccad1e37ab0a6c5dbd73c8c6bd6b7bca6ac9a15
@@ -0,0 +1,14 @@
+import { Directive, AfterViewChecked } from '@angular/core';
+
+declare var componentHandler: any;
+
+@Directive({
+ selector: '[mdl]'
+})
+
+// http://stackoverflow.com/a/39040342/6432160
+export class MDL implements AfterViewChecked {
+ ngAfterViewChecked() {
+ componentHandler.upgradeAllRegistered();
+ }
+}
@@ -4,11 +4,12 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { FormsModule } from '@angular/forms';
import { HttpModule, JsonpModule } from '@angular/http';
+import { MDL } from './MaterialDesignLiteUpgradeElement';
import { DashboardComponent } from './dashboard.component';
import { ShuttleFormComponent} from '../shuttleform/shuttleform.component';
@NgModule({
imports: [BrowserModule, FormsModule, HttpModule, JsonpModule],
- declarations: [DashboardComponent, ShuttleFormComponent],
+ declarations: [DashboardComponent, ShuttleFormComponent, MDL],
bootstrap: [DashboardComponent]
})
export class DashboardModule { }
@@ -1,4 +1,4 @@
-<div class="dashboard-container">
+<div class="dashboard-container" mdl>
<!-- <div class="search-container">
@@ -99,6 +99,7 @@ <h2 class="mdl-card__title-text">{{shuttleGroup.origin[0].name}}
</p>
</div>
<div class="mdl-card__actions mdl-card--border">
+ <!-- TODO disable if user is already signed up -->
<a class="mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect">
Sign Up
</a>

0 comments on commit 6ccad1e

Please sign in to comment.