Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // <input type="text" class="form-control" trim #giftName />
- import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
- export class UserComponent implements OnInit {
- userNickName: String = '';
- ..
- onAddGift(giftName: HTMLInputElement) {
- this.userGiftName = giftName.value;
- ..
- ..
- }
- export class UserComponent implements OnInit {
- @ViewChild('nickName') nickName : ElementRef;
- userNickName: String = '';
- ..
- onAddGift(nickName: HTMLInputElement) {
- ..
- this.userNickName = nickName.nativeElement.value;
- ..
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement