Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 错误:模板分析错误:';超级选项卡按钮';不是离子3中的已知元素_Angularjs_Angular_Ionic Framework_Ionic3_Supertab - Fatal编程技术网

Angularjs 错误:模板分析错误:';超级选项卡按钮';不是离子3中的已知元素

Angularjs 错误:模板分析错误:';超级选项卡按钮';不是离子3中的已知元素,angularjs,angular,ionic-framework,ionic3,supertab,Angularjs,Angular,Ionic Framework,Ionic3,Supertab,我尝试在angular ionic 3中使用super tab,但我得到了错误,我已经声明了super tab,但它不起作用 ERROR Error: Uncaught (in promise): Error: Template parse errors: 'super-tab-button' is not a known element: 1. If 'super-tab-button' is an Angular component, then verify that it is part

我尝试在angular ionic 3中使用super tab,但我得到了错误,我已经声明了super tab,但它不起作用

ERROR Error: Uncaught (in promise): Error: Template parse errors:
'super-tab-button' is not a known element:
1. If 'super-tab-button' is an Angular component, then verify that it is part of this module.
2. If 'super-tab-button' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("<super-tabs-toolbar slot="top" no-border>
 [ERROR ->]<super-tab-button (click)="switchTab('keyFields')">
      <ion-label>Key Fields</ion-label>
    </sup"): ng:///MyContactsDetailPageModule/MyContactsDetailPage.html@34:4


import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { SuperTabsModule } from 'ionic2-super-tabs';
import { MyContactsDetailPage } from './my-contacts-detail';

@NgModule({
  declarations: [
    MyContactsDetailPage,
  ],
  imports: [
    IonicPageModule.forChild(MyContactsDetailPage),
    SuperTabsModule
  ],
})
export class MyContactsDetailPageModule {}

你们能帮我解决这个问题吗?谢谢

请将您的代码与

您的实现不正确

模块在其他模块中导入

在组件中,应该导入实际的类/组件

您的contact-details.ts应该是这样的:

import { SuperTabs } from 'ionic2-super-tabs';

@IonicPage()
@Component({
  selector: 'page-my-contacts-detail',
  templateUrl: 'my-contacts-detail.html',
})
export class MyContactsDetailPage {
  private pageActive: any ;
  @ViewChild(SuperTabs) superTabs: SuperTabs;
  
  constructor(public navCtrl: NavController, public navParams: NavParams) {
  }

  ionViewDidLoad() {
    this.pageActive = 'keyFields';
  }

  private switchTab(page) {
    this.pageActive = page;
  }
}

请同时发布MyContactsDetailPage组件的代码。您应该有一些类似于本文的内容@我已经编辑了这个问题,也许你可以帮我,谢谢
import { SuperTabsModule } from 'ionic2-super-tabs/dist/super-tabs.module';

@IonicPage()
@Component({
  selector: 'page-my-contacts-detail',
  templateUrl: 'my-contacts-detail.html',
})
export class MyContactsDetailPage {
  private pageActive: any ;
  @ViewChild(SuperTabsModule) superTabs: SuperTabsModule;
  
  constructor(public navCtrl: NavController, public navParams: NavParams) {
  }

  ionViewDidLoad() {
    this.pageActive = 'keyFields';
  }

  private switchTab(page) {
    this.pageActive = page;
  }
}
import { SuperTabs } from 'ionic2-super-tabs';

@IonicPage()
@Component({
  selector: 'page-my-contacts-detail',
  templateUrl: 'my-contacts-detail.html',
})
export class MyContactsDetailPage {
  private pageActive: any ;
  @ViewChild(SuperTabs) superTabs: SuperTabs;
  
  constructor(public navCtrl: NavController, public navParams: NavParams) {
  }

  ionViewDidLoad() {
    this.pageActive = 'keyFields';
  }

  private switchTab(page) {
    this.pageActive = page;
  }
}