Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. // <input type="text" class="form-control" trim #giftName />
  2.  
  3.  
  4. import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
  5.  
  6. export class UserComponent implements OnInit {
  7. userNickName: String = '';
  8.  
  9. ..
  10.  
  11. onAddGift(giftName: HTMLInputElement) {
  12. this.userGiftName = giftName.value;
  13. ..
  14. ..
  15. }
  16.  
  17. export class UserComponent implements OnInit {
  18. @ViewChild('nickName') nickName : ElementRef;
  19. userNickName: String = '';
  20.  
  21. ..
  22.  
  23. onAddGift(nickName: HTMLInputElement) {
  24. ..
  25. this.userNickName = nickName.nativeElement.value;
  26. ..
  27. }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement