【问题标题】:When I run the command to build ionic app: ionic cordova build android --prod --verbose. I get the following error:当我运行命令来构建 ionic 应用程序时:ionic cordova build android --prod --verbose。我收到以下错误:
【发布时间】:2020-04-10 12:17:29
【问题描述】:

当我运行命令来构建 ionic 应用程序时:ionic cordova build android --prod --verbose。 我收到以下错误:

错误:“IonInput”不是已知元素:

  1. 如果“IonInput”是一个 Angular 组件,则验证它是否是该模块的一部分。

  2. 要允许任何元素将“NO_ERRORS_SCHEMA”添加到此组件的“@NgModule.schemas”。

(">Please enter the ip address of the server running machine</h3>
  <h2>Example 192.168.0.118 </h2>
  [ERROR ->]<IonInput value="custom" [(ngModel)]="ip_address"></IonInput>
  <IonButton (click)="ipSave()" color="")

:“IonButton”不是已知元素:

  1. 如果“IonButton”是一个 Angular 组件,则验证它是该模块的一部分。
  2. 要允许任何元素添加“NO_ERRORS_SCHEMA”到该组件的“@NgModule.schemas”。
("  <h2>Example 192.168.0.118 </h2>
  <IonInput value="custom" [(ngModel)]="ip_address"></IonInput>
  [ERROR ->]<IonButton (click)="ipSave()" color="primary">Save</IonButton>
</ion-content>
")

src/app/layout/touring/touring.page.html(8,18): : 预期 0 个参数,但得到 1 个。

[ERROR] 运行子进程 ng 时出错。

感谢任何帮助。 提前致谢。

【问题讨论】:

  • 您应该阅读文档。 &lt;IonInput&gt;, &lt;IonIcon&gt; 等用于基于 React 的应用程序。如果你使用 Angular,你应该使用 &lt;ion-input&gt;&lt;/ion-input&gt; or &lt;ion-icon&gt;&lt;ion-icon&gt;
  • 谢谢,我很感激

标签: ionic-framework ionic4


【解决方案1】:

您将 React 标签与 Angular 指令混合在一起。有了您的错误消息,我可以放心地假设您使用的是 Ionic/Angular。确保您遵循 Angular 文档。

【讨论】:

    猜你喜欢
    • 2020-12-17
    • 1970-01-01
    • 1970-01-01
    • 2019-10-05
    • 1970-01-01
    • 2021-01-13
    • 2019-04-19
    • 2023-03-31
    • 1970-01-01
    相关资源
    最近更新 更多