简体   繁体   English

“LoginComponent”类型上不存在属性“错误”

[英]Property 'error' does not exist on type 'LoginComponent'

<div class="col-md-12">
  <p><strong>Login Page</strong></p>
  
  <form ng-submit="formSubmit()" class="form">
    <div class="col-md-4">
      <div class="form-group">
        <input type="text" class="form-control" ng-model="username" placeholder="username" required=""/>
      </div> 

      <div class="form-group">
        <input type="password" class="form-control" ng-model="password" placeholder="password" required=""/>
      </div>

      <div class="form-group">
        <button type="submit" class="btn btn-success">Login</button>
        <span class="text-danger" style="color:red">{{error}}</span>

see this "errors" it is not working as it is said Property 'error' does not exist on type 'LoginComponent'.看到这个“错误”它不起作用,因为据说“登录组件”类型上不存在属性“错误”。 enter image description here在此处输入图像描述

    </div>
  </form>
</div>

It means you dont have a property called error in your ts file.这意味着您的 ts 文件中没有名为 error 的属性。 I dont know what error needs to be but if you add:我不知道需要什么错误,但如果您添加:

error = '';

Its going to stop showing as an error.它会停止显示为错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM