【发布时间】:2019-04-24 14:28:18
【问题描述】:
您好,我有一个简单的 Angular 5 应用程序,可以将图像上传到我的网络服务器。这个 Angular 5 应用程序在 chrome(移动/桌面)和 Safari 桌面版中完美运行。但是当我使用 Safari 作为网络浏览器从我的 iPhone 访问它时,它不会呈现.....为了能够工作,我必须启用 JS:
当我在 IOS 中进行此配置时,Web 应用程序可以正常工作...那么我的问题是....我可以做些什么才能在移动 safari 中呈现我的 Angular Web 应用程序,而无需在其中进行此配置IOS?
角度代码:
HTML
<div class="custom-file">
<input type="file" class="custom-file-input" lang="es" (change)="onFileChange($event)">
<label class="custom-file-label" for="customFileLang">{{fileName}}</label>
</div>
TS
export class AppComponent{
title = 'app';
fileName:string;
base64:string;
constructor(private imageService: ImageService) {
}
onFileChange(event) {
let image:File = event.target.files[0];
this.base64=image.name;
this.imageService.saveImage(image).subscribe();
}
非常感谢!
【问题讨论】:
-
你能澄清你的意思吗?我似乎是在说 iOS 上的 Safari 禁用了 JS,但您希望 JS 应用程序无论如何都能正常工作。似乎答案是在 Safari iOS 中启用 JS。我错过了什么?
-
问题是这个选项在IOS默认是禁用的,那么每个想要使用我的应用程序的用户都必须启用javascript。这可能会导致我的应用程序无法使用,因为他们可能认为它不起作用,所以想法是防止每个用户都必须这样做......他怎么能这样做?
-
在 js 未启用的情况下显示消息说他们必须启用它?
-
我怎么能这样做?
标签: javascript angular typescript