aboutsummaryrefslogtreecommitdiff
path: root/src/app/create-identity/create-identity.component.ts
diff options
context:
space:
mode:
authorPhil <phil.buschmann@tum.de>2018-06-04 20:48:54 +0200
committerPhil <phil.buschmann@tum.de>2018-06-04 20:48:54 +0200
commit4e29a546ba125186f43c6a7bd280ae7857ad4131 (patch)
tree1fb64e75666dda167126efbc7eafd20b1bbac6d0 /src/app/create-identity/create-identity.component.ts
parent4c01dd54cc3c68ddfd700d586fad000df075506f (diff)
downloadgnunet-webui-4e29a546ba125186f43c6a7bd280ae7857ad4131.tar.gz
gnunet-webui-4e29a546ba125186f43c6a7bd280ae7857ad4131.zip
Updated identity interface
Diffstat (limited to 'src/app/create-identity/create-identity.component.ts')
-rw-r--r--src/app/create-identity/create-identity.component.ts35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/app/create-identity/create-identity.component.ts b/src/app/create-identity/create-identity.component.ts
new file mode 100644
index 0000000..2ba7fce
--- /dev/null
+++ b/src/app/create-identity/create-identity.component.ts
@@ -0,0 +1,35 @@
1import { Component, OnInit } from '@angular/core';
2
3import { ApiService } from '../api.service';
4import { IdentityPageComponent } from '../identity-page/identity-page.component';
5
6@Component({
7 selector: 'create-identity-component',
8 templateUrl: './create-identity.component.html'
9})
10export class CreateIdentityComponent implements OnInit {
11
12 private input_text: string = '';
13 private json: any = {'name':''};
14 private is_free:boolean = true;
15
16 constructor(private apiService: ApiService,
17 private identity: IdentityPageComponent) { }
18
19 ngOnInit() {
20 }
21
22 onClick() {
23 if (this.input_text != "" && this.is_free){
24 this.is_free = false;
25 this.json.name = this.input_text;
26 this.apiService.createIdentity(this.json).subscribe(test => {
27 this.identity.getAPIs();
28 this.is_free = true;
29 });
30 } else {
31 alert("No input");
32 }
33 }
34
35}