离子3打字稿错误'离子页脚'不是已知的元素

时间:2018-06-08 02:42:20

标签: angular typescript ionic-framework ionic3

我完成了我的应用程序构建并在Android上发布它,当我移动到ios(我在VMware上构建)时,当我运行正常的ios构建时,它可以工作,但我制作构建ios --prod它给了我这些错误:

   typescript error 
            'ion-icon' is not a known element: 1. If 'ion-icon' is an Angular component, then verify that it is part of 
            this module. 2. If 'ion-icon' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the 
            '@NgModule.schemas' of this component to suppress this message. ("-footer class="footer-style-dark"> 
            <ion-toolbar> <ion-title (click)="openAppointment()"> [ERROR ->]<ion-icon class="home"></ion-icon> 
            <span>Book appointment</span></ion-title> </ion-toolbar> </i") 

[17:35:34]  typescript error 
            'ion-title' is not a known element: 1. If 'ion-title' is an Angular component, then verify that it is part 
            of this module. 2. If 'ion-title' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the 
            '@NgModule.schemas' of this component to suppress this message. ("<ion-footer class="footer-style-dark"> 
            <ion-toolbar> [ERROR ->]<ion-title (click)="openAppointment()"> <ion-icon class="home"></ion-icon> 
            <span>Book appointment</s") 

[17:35:34]  typescript error 
            'ion-toolbar' is not a known element: 1. If 'ion-toolbar' is an Angular component, then verify that it is 
            part of this module. 2. If 'ion-toolbar' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the 
            '@NgModule.schemas' of this component to suppress this message. ("<ion-footer class="footer-style-dark"> 
            [ERROR ->]<ion-toolbar> <ion-title (click)="openAppointment()"> <ion-icon class="home"></ion-icon> <span") 

[17:35:34]  typescript error 
            'ion-footer' is not a known element: 1. If 'ion-footer' is an Angular component, then verify that it is part 
            of this module. 2. If 'ion-footer' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the 
            '@NgModule.schemas' of this component to suppress this message. ("[ERROR ->]<ion-footer 
            class="footer-style-dark"> <ion-toolbar> <ion-title (click)="openAppointment()"") 

Error: The Angular AoT build failed. See the issues above
at /Users/x/Desktop/mybeauty/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:237:55
    at step (/Users/x/Desktop/mybeauty/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:32:23)
    at Object.next (/Users/x/Desktop/mybeauty/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:13:53)
    at fulfilled (/Users/x/Desktop/mybeauty/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:4:58)
[17:35:34]  copy finished in 23.22 s 

我有多个页面。我在ion-content之后添加了HTML文件。这段代码

<ion-footer >
  <ion-toolbar color="primary">
      <ion-title  (click)="openAppointment()" text-center>  <ion-icon name="md-calendar" style="font-size: 25px;"></ion-icon> &nbsp;<span>  order now</span></ion-title>
    </ion-toolbar>
</ion-footer>

我搜索了我尝试过很多的解决方案,但是对我来说不起作用,

  • 我尝试将CUSTOM_ELEMENTS_SCHEMA添加到a​​pp.module.ts和所有内容 page.module.ts

    我试过CUSTOM_ELEMENTS_SCHEMA&amp; NO_ERRORS_SCHEMA。我加了它和
    进口它。但它不起作用。问题是我从所有页面删除了该页脚。但它给了我同样的错误。

  • 我尝试在所有page.module.ts。
  • 上导入ionicmodule

我的app.module.ts(我使用延迟加载,它给了我同样的错误,我删除了所有pages.module.ts&amp;导入app.module.ts上的所有页面,如下所示,但错误仍然相同)。 包含离子页脚的页面是:ServicepagePages,Offerspage,Specialistpage。

    import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { ReactiveFormsModule} from '@angular/forms';
import {EmailComposer} from '@ionic-native/email-composer';
import { CallNumber } from '@ionic-native/call-number';



import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
import { AboutPage } from '../pages/about/about';
import { AppointmentPage } from '../pages/appointment/appointment';
import { ContactusPage } from '../pages/contactus/contactus';

import { OffersPage } from '../pages/offers/offers';
import { ServicepagePage } from '../pages/servicepage/servicepage';
import { SpecialistPage } from '../pages/specialist/specialist';

import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { AuthProvider } from '../providers/auth/auth';
import { ClientsProvider } from '../providers/clients/clients';
import { HttpClientModule } from '@angular/common/http';
import { SocialSharing } from '@ionic-native/social-sharing';
import { AppRate } from '@ionic-native/app-rate';


@NgModule({
  declarations: [
    MyApp,
    HomePage,
    AppointmentPage,
    ContactusPage,
    AboutPage,
    OffersPage,
    ServicepagePage,
    SpecialistPage









  ],
  imports: [
    BrowserModule,
    IonicModule.forRoot(MyApp),
    HttpClientModule,
    ReactiveFormsModule,

  ],schemas:      [ CUSTOM_ELEMENTS_SCHEMA,NO_ERRORS_SCHEMA  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    HomePage,
    AppointmentPage,
    ContactusPage,
    AboutPage,
    OffersPage,
    ServicepagePage,
    SpecialistPage



  ],
  providers: [
    StatusBar,
    SplashScreen,
    {provide: ErrorHandler, useClass: IonicErrorHandler},
    AuthProvider,
    ClientsProvider,
    EmailComposer,
    CallNumber,
    SocialSharing,
    AppRate
    ]
})
export class AppModule {
   CUSTOM_ELEMENTS_SCHEMA;

}

0 个答案:

没有答案