如何validate
在以 4 角及以上的角度上传之前上传文件?
我想file type
和file size
在角4和上述验证。
我的问题截图
对于每个文件,我都获得了正确的文件大小和类型,除了.msg文件。如何获取文件类型的应用程序/ vnd.ms-Outlook应用程序/八位字节流 的展望文件。请帮帮我。
我正在使用模态并想在关闭模态后调用一个函数。
我试过onDidDismiss()
方法,但它显示一个错误
async openModal() {
const modal = await this.modal.create({ component: UploadPage });
modal.onDidDismiss(() => {
this.getData();
});
return await modal.present();
}
getData() {
......
}
Run Code Online (Sandbox Code Playgroud)
这样我得到了一个错误 "Expected 0 arguments, but got 1."
我正在使用ionic中的GeoLocation NativeGeoCoder插件进行获取。我想在多个页面中使用位置。
我在创建函数 app.component.ts
constructor(
private geolocation: Geolocation,
private nativegeocoder: NativeGeocoder
) {
this.getGeoLocation();
}
getGeoLocation() {
const options: NativeGeocoderOptions = {
useLocale: true,
maxResults: 5
};
this.geolocation.getCurrentPosition().then((resp) => {
console.log(resp);
this.nativegeocoder.reverseGeocode(resp.coords.latitude, resp.coords.longitude, options)
.then((result: NativeGeocoderResult[]) => {
console.log(JSON.stringify(result[0]));
}).catch((error) => console.log(error));
}).catch((error) => {
console.log(error);
});
}
Run Code Online (Sandbox Code Playgroud)
如何使用和调用functio刷新位置。