Html 离子4显示何时隐藏何时
我尝试对web和设备使用相同的html,并且在某些情况下需要显示/隐藏web html或设备html 离子4中的指令和指令在哪里?如果它们消失了,它们是否被其他东西所取代Html 离子4显示何时隐藏何时,html,ionic-framework,angular-directive,ionic4,Html,Ionic Framework,Angular Directive,Ionic4,我尝试对web和设备使用相同的html,并且在某些情况下需要显示/隐藏web html或设备html 离子4中的指令和指令在哪里?如果它们消失了,它们是否被其他东西所取代 到目前为止,我所能找到的只是这些,但这并不能说明太多。是的,离子4有这些指令 离子隐藏时 及 例如,如果您只想在android中显示 东西 更新 显然,这些指令在上一个测试版中刚刚从Ionic 4中删除。参见此要将我的应用程序升级到ionic 4,我使用此替代方案根据设备的操作系统显示正确的按钮,它非常有效,而且非常容易实
到目前为止,我所能找到的只是这些,但这并不能说明太多。是的,离子4有这些指令
离子隐藏时
及
例如,如果您只想在android中显示
东西
更新
显然,这些指令在上一个测试版中刚刚从Ionic 4中删除。参见此要将我的应用程序升级到ionic 4,我使用此替代方案根据设备的操作系统显示正确的按钮,它非常有效,而且非常容易实现:
import { Component, OnInit} from '@angular/core';
import { Platform } from '@ionic/angular';
@Component({
selector: 'update-password',
templateUrl: './update-password.component.html'
})
export class UpdatePasswordComponent implements OnInit {
constructor(
public platform: Platform
) { }
更新密码
取消
有一个Ionic 4代码笔,显示如何实现与已删除指令相同的效果,例如,此范围仅在iOS上显示
Show iOS
Angular抱怨'ion-Show-when'不是已知元素
。你有文档或其他来源的链接吗?嗨!你是对的。显然,这些指令在上一个测试版中刚刚从Ionic 4中删除。看到这个了吗
import { Component, OnInit} from '@angular/core';
import { Platform } from '@ionic/angular';
@Component({
selector: 'update-password',
templateUrl: './update-password.component.html'
})
export class UpdatePasswordComponent implements OnInit {
constructor(
public platform: Platform
) { }
<ion-header>
<ion-toolbar>
<ion-title>Update Password</ion-title>
<ion-buttons slot="start">
<ion-button (click)="dismiss()">
<ion-text color="primary" *ngIf="platform.is('ios')">Cancel</ion-text>
<ion-icon name="md-close" *ngIf="!platform.is('ios')"></ion-icon>
</ion-button>
</ion-buttons>
</ion-toolbar>
</ion-header>