changeset 230:c274af5487c6

Add a progress bar, having issues with md-spinner not updating and also animating when it shouldn't
author Lucas Thompson <dev@lucas.im>
date Mon, 24 Apr 2017 14:40:32 +0100
parents efa23f33393b
children 0249ee049353
files src/app/progress-bar/progress-bar.ts
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/app/progress-bar/progress-bar.ts	Mon Apr 24 14:40:32 2017 +0100
@@ -0,0 +1,21 @@
+/**
+ * Created by lucas on 24/04/2017.
+ */
+
+
+import {ChangeDetectionStrategy, Component, Input} from "@angular/core";
+@Component({
+  selector: 'ugly-progress-bar',
+  template: `
+    <md-progress-bar
+      [attr.color]="'primary'"
+      [mode]="isDeterminate ? 'determinate' : 'indeterminate'"
+      [value]="progress"
+    ></md-progress-bar>
+  `,
+  changeDetection: ChangeDetectionStrategy.OnPush
+})
+export class ProgressBarComponent {
+  @Input() isDeterminate: boolean = false;
+  @Input() progress: number;
+}