diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index b79eb98..8c3f74e 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -7,6 +7,8 @@ import { FormComponent } from './form.component';
import { TextComponent } from './text.component';
import { RadioComponent } from './radio.component';
import { StepComponent } from './step.component';
+import { CameraComponent } from './camera.component';
+import { SignComponent } from './sign.component';
@NgModule({
declarations: [
@@ -15,6 +17,8 @@ import { StepComponent } from './step.component';
TextComponent,
RadioComponent,
StepComponent,
+ CameraComponent,
+ SignComponent,
],
imports: [
BrowserModule,
diff --git a/src/app/camera.component.ts b/src/app/camera.component.ts
new file mode 100644
index 0000000..975a293
--- /dev/null
+++ b/src/app/camera.component.ts
@@ -0,0 +1,58 @@
+import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
+
+@Component({
+ selector: 'app-camera',
+ template: `
+
+
+
+
+
![]()
+
+
+
+
+ `
+})
+export class CameraComponent implements OnInit {
+
+ @Input() field: Field;
+ @Output() update: EventEmitter = new EventEmitter();
+
+ video: HTMLVideoElement;
+
+ ngOnInit() { console.log("Smile!"); }
+
+ ngAfterViewInit() {
+
+ this.video = document.getElementById("video") as HTMLVideoElement;
+
+ navigator.mediaDevices.getUserMedia({video: true, audio: false})
+
+ .then((stream) => {
+ this.video.srcObject = stream;
+ this.video.play();
+
+ });
+
+ }
+
+ capture() {
+
+ const canvas = document.createElement("canvas") as HTMLCanvasElement;
+
+ canvas.width = this.video.videoWidth;
+ canvas.height = this.video.videoHeight;
+
+ canvas
+ .getContext("2d")
+ .drawImage(this.video, 0, 0, canvas.width, canvas.height);
+
+ this.field.ok = true;
+ this.field.value = canvas.toDataURL();
+
+ this.update.emit();
+
+ }
+
+}
diff --git a/src/app/form.component.ts b/src/app/form.component.ts
index 699009d..715719e 100644
--- a/src/app/form.component.ts
+++ b/src/app/form.component.ts
@@ -15,6 +15,7 @@ import { Component, OnInit, Input } from '@angular/core';
>