(索引):13未捕获的ReferenceError:未在HTMLButtonElement.onclick上定义LoginUser

时间:2018-07-12 21:22:31

标签: html angular

<div class="clearfix">&nbsp;</div>
<div style="text-align: center">
<input #user matInput placeholder="username" type="text" name = "username" id="username">
<div class="clearfix">&nbsp;</div>
<input #pass matInput placeholder="password" type="password" name="password" id="password">
<div class="clearfix">&nbsp;</div>
<button onclick="LoginUser(user,pass)" class ="btn btn-primary" type ="submit" mat-raised-button >Click me!</button>
</div>

import { Component } from '@angular/core';
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  
  LoginUser(user:HTMLInputElement,pass:HTMLInputElement) {
    console.log(user.value);
    console.log(pass.value);
   }


}

我正在使用Angular材质设计 我无法在控制台上打印用户名和密码数据

0 个答案:

没有答案