Commit abc46180 authored by dev0tion's avatar dev0tion

Add copy to clipboard at receive component

parent 1f09b6fa
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
"angular2-material-datepicker": "^0.5.0", "angular2-material-datepicker": "^0.5.0",
"bootstrap": "^4.0.0-alpha.6", "bootstrap": "^4.0.0-alpha.6",
"core-js": "^2.4.1", "core-js": "^2.4.1",
"ngx-clipboard": "^8.0.2",
"rxjs": "^5.4.0", "rxjs": "^5.4.0",
"zone.js": "^0.8.10" "zone.js": "^0.8.10"
}, },
......
...@@ -3,7 +3,8 @@ import { BrowserModule } from '@angular/platform-browser'; ...@@ -3,7 +3,8 @@ import { BrowserModule } from '@angular/platform-browser';
import { FormsModule, ReactiveFormsModule } from "@angular/forms"; import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { HttpModule } from '@angular/http'; import { HttpModule } from '@angular/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { ClipboardModule } from 'ngx-clipboard';
import { SharedModule } from './shared/shared.module'; import { SharedModule } from './shared/shared.module';
...@@ -24,6 +25,7 @@ import { ReceiveComponent } from './wallet/receive/receive.component'; ...@@ -24,6 +25,7 @@ import { ReceiveComponent } from './wallet/receive/receive.component';
AppRoutingModule, AppRoutingModule,
BrowserModule, BrowserModule,
BrowserAnimationsModule, BrowserAnimationsModule,
ClipboardModule,
ReactiveFormsModule, ReactiveFormsModule,
FormsModule, FormsModule,
HttpModule, HttpModule,
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
</thead> </thead>
<tr> <tr>
<td>{{ address }}</td> <td>{{ address }}</td>
<td><button class="btn" type="button" ngxClipboard [cbContent]="address" (cbOnSuccess)="isCopied1=true" [class.btn-success]= "isCopied1">Copy</button>
</tr> </tr>
</table> </table>
</div> </div>
......
...@@ -16,13 +16,17 @@ import {NgbModal, NgbActiveModal} from '@ng-bootstrap/ng-bootstrap'; ...@@ -16,13 +16,17 @@ import {NgbModal, NgbActiveModal} from '@ng-bootstrap/ng-bootstrap';
export class ReceiveComponent { export class ReceiveComponent {
constructor(private apiService: ApiService, private globalService: GlobalService, public activeModal: NgbActiveModal) {} constructor(private apiService: ApiService, private globalService: GlobalService, public activeModal: NgbActiveModal) {}
private address: any; private address: any = "";
private errorMessage: string; private errorMessage: string;
ngOnInit() { ngOnInit() {
this.getUnusedReceiveAddresses(); this.getUnusedReceiveAddresses();
} }
private copyAddress() {
}
private getUnusedReceiveAddresses() { private getUnusedReceiveAddresses() {
let walletInfo = new WalletInfo(this.globalService.getWalletName(), this.globalService.getCoinType()) let walletInfo = new WalletInfo(this.globalService.getWalletName(), this.globalService.getCoinType())
this.apiService.getUnusedReceiveAddress(walletInfo) this.apiService.getUnusedReceiveAddress(walletInfo)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment