如何在Ionic/Angular中使用管道转换a*ngFor循环的返回

如何在Ionic/Angular中使用管道转换a*ngFor循环的返回,angular,ionic-framework,ngfor,translate,side-menu,Angular,Ionic Framework,Ngfor,Translate,Side Menu,我对爱奥尼亚/安格鲁是新手,因此请求您的帮助。到目前为止,我设法使翻译和ngFor在我的脚本中工作得很好,但我想在我的应用程序的侧菜单中混合它,这样它就会自动翻译 下面是我在app.html中的菜单:它列出了app.components.ts中的所有页面 <ion-list> <button ion-item *ngFor="let p of pages" (click)="openPage(p)"> {{p.title}} </button>

我对爱奥尼亚/安格鲁是新手,因此请求您的帮助。到目前为止,我设法使翻译和ngFor在我的脚本中工作得很好,但我想在我的应用程序的侧菜单中混合它,这样它就会自动翻译

下面是我在app.html中的菜单:它列出了app.components.ts中的所有页面

<ion-list>
  <button ion-item *ngFor="let p of pages" (click)="openPage(p)">
    {{p.title}}
  </button>
</ion-list>
再一次,一切正常,直到我尝试翻译循环内容


提前非常感谢

你们两个把事情弄得这么简单,我现在觉得自己很愚蠢

我只需在app.html中替换:


感谢您如此快速地回答了这么简单的问题。

只需添加即可

{{ (p.title) | translate }}

尝试更改:{{{p.title}}{translate}}
import { Platform, MenuController, NavController, Nav } from 'ionic-angular'; 
import { HomePage } from '../pages/home/home';
import { SingleTechniquePage } from '../pages/single-technique/single-technique';
import { AboutPage } from '../pages/about/about';
import { HelloIonicPage } from '../pages/hello-ionic/hello-ionic';
import { ListPage } from '../pages/list/list';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { TranslateService, TranslateModule } from '@ngx-translate/core';

(...)

this.pages = [
      { title: 'menu_singletechnique', component: SingleTechniquePage },
      { title: 'menu_helloionic', component: HelloIonicPage },
      { title: 'menu_firstlist', component: ListPage },
      { title: 'menu_about', component: AboutPage }

    ];
  }

 (...)

  openPage(page) {
    // close the menu when clicking a link from the menu
    this.menu.close();
    // navigate to the new page if it is not the current page
    this.nav.setRoot(page.component);
  }
{{ {{p.title}} | translate }}
{{ p.title | translate }}
{{ (p.title) | translate }}