Cordova 8 / IOS 12 / Angular 6
我有一个带有登录表单的cordova 应用程序。除此之外,一切都运行良好。
在ios上,当用户在表单中聚焦时,苹果会提示用户输入保存的密码。当用户使用此 ios 自动填充功能时,表单不会检测到新值并且数据保持为空。(但用户可以看到出现在屏幕上的凭据)
这是我的登录表单:
<form (ngSubmit)="login()" [formGroup]="loginForm">
<input type="email" formControlName="username" name="username"/>
<input type="password" formControlName="password" name="password"/>
<button class="transparent-button primary">Login</button>
</form>
Run Code Online (Sandbox Code Playgroud)
在我的组件中:
constructor(
/* ... */
) {
this.loginForm = formBuilder.group({
username: ["", Validators.required],
password: ["", Validators.required]
});
};
login(){
//this.loginForm.value.username and
this.loginForm.value.password stay empty when user
autofill
}
Run Code Online (Sandbox Code Playgroud)
我也尝试过使用模板驱动的表单:同样的问题。因此,Apple 现在阻止了我的应用程序的发布。这是 ios/cordova 的已知问题吗?
谢谢
我正在尝试将 pwa 功能添加到在 Angular 8 上运行的网站。我遵循了很多官方和非官方的教程,但我不明白我做错了什么。
ngsw-config.json 是这样的:
{
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
"index": "/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/manifest.webmanifest",
"/*.css",
"/*.js",
"/*.min.js"
],
"urls": [
"https://fonts.googleapis.com/**"
]
}
}, {
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**",
"/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
]
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
我可以在 Chrome 开发控制台的“应用程序”选项卡中看到服务工作线程已注册并正在运行。
但我有两个主要问题。
索引页面似乎无法提供服务,服务工作人员仍在注册并运行。
我可以在在线模式下看到我从 Service Worker 获取索引页,那么为什么它在离线模式下不起作用?