小编Mok*_*oru的帖子

我没有在打字稿 angular7 中获取文本框值

我正在使用 angular7。只需制作一些文本框,然后提醒该文本框值。但我无法获得打字稿中的值。请帮助我如何进行更多这一步。

关于.component.html

<input type="text" name="username">
<button (click)="lgbtnclick()" type="button" name="button"></button>
Run Code Online (Sandbox Code Playgroud)

关于.component.ts

  import { Component, OnInit } from '@angular/core';
  @Component({
  selector: 'app-about',
  templateUrl: './about.component.html',
  styleUrls: ['./about.component.scss']
  })

  export class AboutComponent implements OnInit {
   name : string;

   constructor() { }

   ngOnInit() {
   }

   lgbtnclick(){
      alert(this.name)
      console.log(Error)
   }
}
Run Code Online (Sandbox Code Playgroud)

警报讯息:

undefined
Run Code Online (Sandbox Code Playgroud)

scripting typescript angular

6
推荐指数
1
解决办法
1万
查看次数

如何使用Angular 7发送电子邮件

我现在正在使用Angular7,开始开发应用程序,我想知道如何从angular7应用程序发送电子邮件。请分享示例代码

email scripting typescript angular

4
推荐指数
2
解决办法
1万
查看次数

标签 统计

angular ×2

scripting ×2

typescript ×2

email ×1