如何以新页面从右侧而不是从底部进入的方式修改navPush?(应该有一些参数,但我没有在离子文档中找到它们
谢谢!
可以说我有以下列表:
<ion-list radio-group [(ngModel)]="autoManufacturers">
<ion-list-header>
Auto Manufacturers
</ion-list-header>
<ion-item>
<ion-label>Cord</ion-label>
<ion-radio value="cord"></ion-radio>
</ion-item>
<ion-item>
<ion-label>Duesenberg</ion-label>
<ion-radio value="duesenberg"></ion-radio>
</ion-item>
<ion-item>
<ion-label>Hudson</ion-label>
<ion-radio value="hudson"></ion-radio>
</ion-item>
</ion-list>
Run Code Online (Sandbox Code Playgroud)
根据我从数据库中获得的值,我想检查列表中的项目.让我们说如果我得到值'cord',那么第2项应显示为所选项目.如何使用TypeScript实现此目的?
我正在开发一个Ionic2应用程序.我对registerBackButtonAction功能感到困惑.
我在一个页面上做了这个(比如pageA).它按预期工作.
this.platform.registerBackButtonAction(() => {
console.log("back presed");
this.abortDownloadAndExit();
});
Run Code Online (Sandbox Code Playgroud)
现在我想registerBackButtonAction在其他页面上做一些其他操作(比如PageB).但Ionic正在从pageA采取行动
如何在不同页面上注册不同的作品.
我正在使用Ionic 3,虽然使用tabUrlPath,但点击标签不会更新Url.下面是代码块:
<ion-tabs tabsPlacement="top" tabsHighlight="true">
<ion-tab tabTitle="Details" [root]="details" tabUrlPath="details"></ion-tab>
<ion-tab tabTitle="Issues" [root]="issues" tabUrlPath="issues"></ion-tab>
</ion-tabs>
Run Code Online (Sandbox Code Playgroud)
任何想法,可能会缺少什么?任何帮助将不胜感激.
我已经花了很长时间在这个问题上工作,我无法解决它.当我这样做ionic Cordova build android,直到它到达Cordova build android,任何人都对这里发生的事情有所了解?
我知道如果有权限的问题,但我找不到我要更改的目录
KENRYMAC:RecipeBookApp Kenry$ ionic cordova build android
Running app-scripts build: --platform android --target cordova
[23:36:09] build dev started ...
[23:36:10] clean started ...
[23:36:10] clean finished in 5 ms
[23:36:10] copy started ...
[23:36:10] deeplinks started ...
[23:36:11] deeplinks finished in 161 ms
[23:36:11] transpile started ...
[23:36:51] transpile finished in 40.73 s
[23:36:51] preprocess started ...
[23:36:51] preprocess finished in 1 ms
[23:36:51] webpack started ...
[23:36:52] copy finished …Run Code Online (Sandbox Code Playgroud) 我是Ionic的新手并试图了解如何组织中型应用程序.
每个页面都应该有自己的模块吗?或者将类似的页面分组到同一个模块中会更好吗?甚至可以这样做吗?看来IonicPageModule.forChild()方法只接受一个页面:
IonicPageModule.forChild(AdministerUsersPage)
Run Code Online (Sandbox Code Playgroud)
那么每个页面都可以拥有自己的模块吗?拥有这么多模块有什么缺点吗?
看起来我们从一个极端走到另一个极端 - 没有模块在根上下文中声明所有内容,以便为每个页面分隔模块.
我正在使用Ionic 3来构建一个简单的地图应用程序,以便使用OpenStreet地图图块呈现我正在使用传单(类型版本)的地图
我想让用户下载和缓存地图的可能性,因此我在这里找到了传单离线 并希望使用它,因为它允许我使用我的本地存储来存储图像.
现在我的问题出现了,我正在尝试将打字稿与javascript混合,我无法弄清楚如何使其正常工作.
我做了什么,问题是什么:
我安装了传单类型版本,然后安装了传单离线javascript版本.
现在我在页面中将它们导入如下:
import * as leaflet from 'leaflet';
import 'leaflet-offline';
Run Code Online (Sandbox Code Playgroud)
现在,如果我尝试按照示例中的说明使用库,我会得到一个打字稿错误,它指示我离线的属性不在对象TileLayer中.
leaflet.tileLayer.offline('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', tilesDb, {
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
subdomains: 'abc',
minZoom: 13,
maxZoom: 19,
crossOrigin: true
}).addTo(this.map);
Run Code Online (Sandbox Code Playgroud)
为了避免这种情况,我补充道
export namespace tileLayer {
function wms(baseUrl: string, options?: WMSOptions, offline?: any): TileLayer.WMS;
function offline(url?: any, tilesDb?: any, options?: any): any;
}
Run Code Online (Sandbox Code Playgroud)
该函数offline位于tileLayer本身的命名空间中.
当前的问题 在我尝试运行应用程序的那一刻,一切正常,除了实际的地图,我看不到它,当我调查它时得到的错误如下:
错误类型错误:无法在NewClass._TateUrl(vendor.js:163489)的NewClass._addTile(vendor.js:79419)的NewClass._update(供应商,js:73419)的NewClass.getTileUrl(vendor.js:163489)中读取null的属性'then' .js:79310)在NewClass._setView(vendor.js:79171)的NewClass._resetView(vendor.js:79129)NewClass.fire(vendor.js:68787)NewClass._move(vendor.js:72343)at at NewClass._catchTransitionEnd中的NewClass._onZoomTransitionEnd(vendor.js:72800)(vendor.js:72732)
我确定我犯了一些愚蠢的错误,但我在这个问题上失去了很多时间.
任何人都有一些关于如何解决这个问题的线索?
离子v3。仅当我在警报中放置文本框时才会发生。警报框显示在iPhone等常规设备的顶部。当我为android构建时,它工作正常。复选框,单选按钮等工作正常,并且警报框出现在中间。谁能告诉我为什么?这与Ionic v3有关系吗?
我试图应用cssClass覆盖位置。但是,当用户尝试打开键盘时,屏幕会闪烁。因此,我试图通过在警报出现时保持键盘关闭来使警报中的文本框不集中。仍然没有运气。
请参考相同的图像。
我不知道为什么每次尝试创建应用程序构建时都会遇到此错误。我尝试了许多解决方案,但无法解决此问题。我不知道是否有任何插件引起问题或我的问题代码,firebase或firebase连接。我已删除节点模块并运行npm install并删除并重新添加了android平台,但仍然出现此错误。
import com.google.firebase.iid.FirebaseInstanceIdService;
^
symbol: class FirebaseInstanceIdService
location: package com.google.firebase.iid
C:\Users\user\Downloads\mosque\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePluginInstanceIDService.java:9: error: cannot find symbol
public class FirebasePluginInstanceIDService extends FirebaseInstanceIdService {
^
symbol: class FirebaseInstanceIdService
C:\Users\user\Downloads\mosque\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePlugin.java:508: error: method getByteArray in class FirebaseRemoteConfig cannot be applied to given types;
: FirebaseRemoteConfig.getInstance().getByteArray(key, namespace);
^
required: String
found: String,String
reason: actual and formal argument lists differ in length
C:\Users\user\Downloads\mosque\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePlugin.java:525: error: method getValue in class
FirebaseRemoteConfig cannot be applied to given types;
: FirebaseRemoteConfig.getInstance().getValue(key, namespace);
^
required: String
found: String,String
reason: actual and …Run Code Online (Sandbox Code Playgroud) 在我的离子应用程序中,我正在连接到条纹支付网关。
我有一个firebase在更新客户时会触发的功能。
exports.updateStripeCustomer = functions.database.ref("/Customers/{userId}")
.onUpdate((snapshot, context) => {
const data = snapshot.after.val();
return stripe.customers.createSource(data.payment_sources.customer_id, {
source: data.payment_sources.source
}).then(customer => {
console.log("Update Stripe Customer");
return customer;
},
error => {
return error;
}
);
});
Run Code Online (Sandbox Code Playgroud)
这是我在更新客户的应用程序端中的代码。更新firebase中调用的触发器时,如何在下面的代码中获取触发器(firebase函数)返回的数据?
this.angularDb.object('/Customers/' + firebase.auth().currentUser.uid).update({
cardsetup: 1,
payment_sources: {
customer_id: this.user.customer_id,
source: this.card.source.id
}
}).then((res) => {
loading.dismiss();
alert("card details has been successfully updated.");
this.navCtrl.push(LoginPage);
}, (error) => {
loading.dismiss();
console.log("=========>", error.message)
alert(JSON.stringify(error))
});
Run Code Online (Sandbox Code Playgroud)
如果firebase函数返回错误,则需要显示触发器返回的错误消息。有什么办法吗?