小编Aas*_*rty的帖子

如何在以角度 6 上传之前验证文件

如何validate在以 4 角及以上的角度上传之前上传文件?
我想file typefile size在角4和上述验证。
我的问题截图

对于每个文件,我都获得了正确的文件大小和类型,除了.msg文件。如何获取文件类型的应用程序/ vnd.ms-Outlook应用程序/八位字节流展望文件。请帮帮我。

validation file-upload mime-types angular6

5
推荐指数
1
解决办法
3万
查看次数

在Ionic 4中关闭Modal后如何调用函数

我正在使用模态并想在关闭模态后调用一个函数

我试过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."

javascript ionic-framework angular ionic4

3
推荐指数
1
解决办法
3284
查看次数

如何在Ionic 4的每个页面中使用地理位置

我正在使用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刷新位置。

ionic-framework angular

-1
推荐指数
1
解决办法
51
查看次数