我想创建一个占位符mixin如下.但是,这无法在LESS版本1.7.0中编译.
.placeholder(...) {
::-webkit-input-placeholder: @arguments;
:-moz-placeholder: @arguments;
::-moz-placeholder: @arguments;
:-ms-input-placeholder: @arguments;
}
Run Code Online (Sandbox Code Playgroud) 使用Firebase for web我可以成功创建匿名用户.我还可以创建一个新的电子邮件/密码用户.但是当尝试将匿名用户转换为电子邮件/密码用户时,我收到错误:
auth/provider-already-linked
User can only be linked to one identity for the given provider.
Run Code Online (Sandbox Code Playgroud)
Firebase会在此处的"将匿名帐户转换为永久帐户"部分中记录此过程:https: //firebase.google.com/docs/auth/web/anonymous-auth
这是帐户链接代码.匿名用户已登录.
return firebase.auth().createUserWithEmailAndPassword(email, password).then(newUser => {
// Credential is being successfully retrieved. Note "any" workaround until typescript updated.
let credential = (<any>firebase.auth.EmailAuthProvider).credential(email, password);
firebase.auth().currentUser.link(credential)
.then(user => { return user; })
.catch(err => console.log(err)); // Returns auth/provider-already-linked error.
});
Run Code Online (Sandbox Code Playgroud) 我有一个Angular 6延迟加载选项卡模板,可以正常工作.主页面有一个路由器插座,标签有二级路由器插座.但是,我无法在主菜单中创建显示标签页的routerLink.
此routerLink仅在标签页上尚未显示时才有效.例如
正确链接到:tabs /(about:about)
链接到标签页
如果已经在主页选项卡上(并单击链接),则最终的URL为:
/tabs/(about:about//home:home)
Run Code Online (Sandbox Code Playgroud)
如何创建始终链接到以下内容的routerLink?
/tabs/(about:about)
Run Code Online (Sandbox Code Playgroud)
我对这个打字稿有同样的行为:
this.router.navigate(['/tabs', { outlets: { about: ['about']}}]);
Run Code Online (Sandbox Code Playgroud)
但是,这个打字稿正常工作:
this.router.navigateByUrl('/tabs/(about:about)');
Run Code Online (Sandbox Code Playgroud)
app.component.html
<ion-app>
<nav>
<a [routerLink]="['/tabs', { outlets: { about: 'about' } }]">
This link only works if NOT already on tab page.
</a>
<ion-button (click)="navigateByUrl()">This always works!</ion-button>
</nav>
<router-outlet></router-outlet>
</ion-app>
Run Code Online (Sandbox Code Playgroud)
APP-routing.module.ts
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
const routes: Routes = [
{ path: '', loadChildren: './pages/tabs/tabs.module#TabsPageModule' },
{ path: 'test', …Run Code Online (Sandbox Code Playgroud) 我的Firebase/Ionic 2应用程序在浏览器(离子服务)和本地Android设备(离子运行android)上运行良好.该应用使用Firebase数据库和身份验证功能.
该应用程序也适用于iOS设备.
但是,当我在Android上发布到Google Play进行beta测试时,auth登录方法始终失败并显示错误:"发生了网络错误(例如超时,中断连接或无法访问的主机)." 但Firebase数据库方法运行正常.我只使用Firebase电子邮件/密码提供商.
我已经阅读了我能找到的与此问题类似的所有帖子并尝试了所有这些解决方案.我已升级到所有组件的最新版本.
已安装cordova-plugin-whitelist插件.它默认安装在一个新的Ionic 2项目中.我的理解是以下安全设置不会阻止Firebase.
的index.html
<meta http-equiv="Content-Security-Policy" content="font-src * data:; img-src * data:; default-src * 'unsafe-eval' 'unsafe-inline'; script-src * 'unsafe-eval' 'unsafe-inline'">
Run Code Online (Sandbox Code Playgroud)
config.xml中
<access origin="*"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<allow-navigation href="*"/>
Run Code Online (Sandbox Code Playgroud)
我的服务
public login(email: string, password: string): Observable<any> {
return Observable.fromPromise(
<Promise<any>>firebase.auth().signInWithEmailAndPassword(email, password)
);
}
Run Code Online (Sandbox Code Playgroud)
我的表格
this.authService.login(this.loginForm.value.email, this.loginForm.value.password)
.subscribe(() => {
// Do something!
}, error => {
// A network error has occurred!
});
Run Code Online (Sandbox Code Playgroud)
版本信息
Cordova CLI: 6.5.0
Ionic Framework Version: 2.2.0
Ionic CLI Version: …Run Code Online (Sandbox Code Playgroud) firebase firebase-authentication firebase-realtime-database ionic2
Angluar 5 HttpInterceptor 如何在出错时重试请求?
Angular 文档没有显示 HttpInterceptor 重试的示例:https ://angular.io/guide/http : https://angular.io/api/common/http/HttpInterceptor
请注意,对 HttpClient 对象进行了重试。这在这种情况下没有帮助。
我试图实现的伪逻辑:发送请求 IF 错误响应 THEN 更改请求并重试请求。
此 HttpInterceptor 成功运行请求并捕获错误但不重试请求。
export class AuthInterceptor implements HttpInterceptor {
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
return next
.handle(req)
.do(event => {
}, (err: any) => {
let reqRepeat = req.clone(); // For now, keep it simple. Don't change original request.
return next.handle(req); // Retry request. THIS DOESN'T SEEM TO DO ANYTHING!
})
}
};
Run Code Online (Sandbox Code Playgroud) 如何在 GitHub 拉取请求消息和描述上运行 commitlint? https://github.com/conventional-changelog/commitlint
我们目前在我们的 CI 中运行 commitlint。然而,这在过程中为时已晚,即无效的提交消息已经在分支中。
我能找到的唯一方法是使用 GitHub 应用程序。以下是我找到/尝试过的应用程序。也许唯一的解决方案是构建我们自己的/自定义的 GitHub 应用程序?然而,对 GitHub PR 进行 linting 似乎是一个常见的请求,我觉得我在这里错过了一些基本的东西。
这个 GitHub 应用程序看起来很完美,但目前无法运行:https : //github.com/apps/commitlint
这个 GitHub 应用程序允许通过自定义正则表达式提交消息/描述。但是,我找不到关于 commitlint 是否可以表示为单个正则表达式语句的任何信息。 https://github.com/marketplace/commit-message-lint
此 GitHub 应用程序仅可用于公共存储库——我们的存储库是私有的。 https://github.com/marketplace/commit-lint/plan/MDIyOk1hcmtldHBsYWNlTGlzdGluZ1BsYW4xMjUz#pricing-and-setup
这个 GitHub 应用程序支持多个正则表达式。 https://github.com/ewolfe/prlint
这行PHP代码:
$oauthClient = new OAuth($consumerKey, $consumerSecret, ... etc.
Run Code Online (Sandbox Code Playgroud)
结果有误:
致命错误:未找到"OAuth"类
我正在运行WampServer 2.1,PHP版本5.3.4,Windows Server 2008 R2(相当于Windows 7)
我已经按照以下说明仔细检查了php_oauth.dll的安装:PHP OAUTH class api
如何成功加载oauth扩展并修复此PHP错误?
在 AWS CDK 中,我可以编写 Jest 单元测试来测试资源是否具有特定属性。但是如何测试不是属性的资源 DeletionPolicy 值?
cdk.out/example.template.json(简化)
"AppsUserPool8FD9D0C0": {
"Type": "AWS::Cognito::UserPool",
"Properties": {
"UserPoolName": "test",
...
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain",
"Metadata": {}
}
Run Code Online (Sandbox Code Playgroud)
Jest 属性单元测试通过(简化)
expect(stack).toHaveResourceLike('AWS::Cognito::UserPool', {
"UserPoolName": "test"
});
Run Code Online (Sandbox Code Playgroud)
DeletionPolicy 的 Jest 单元测试失败(简化)
expect(stack).toHaveResourceLike('AWS::Cognito::UserPool', {
"DeletionPolicy": "Retain"
});
Run Code Online (Sandbox Code Playgroud) 项目正在使用PC编号1.将项目复制到外部驱动器并尝试从PC编号2加载项目.两台PC都安装了类似的VS2010 premium.可以在本地运行网站.打开项目时VS2010发出以下错误.
无法打开visual studio 2010,因为此版本的应用程序不支持其项目类型()
错误表示PC号码2上未安装某些内容但是如何找出缺少的软件?
在Magento,是否有最佳实践方法来检测实时/生产站点(与开发站点相比)?例如,仅在开发站点上运行调试代码(不在生产中运行).
如何在单个 AWS S3 存储桶中托管多个 Angular 7 应用程序?IE
每个站点都位于子文件夹中:
/site1
/site2
/site3
Run Code Online (Sandbox Code Playgroud)
通过子文件夹访问的每个站点:
www.mydomain.com/site1
www.mydomain.com/site2
www.mydomain.com/site3
Run Code Online (Sandbox Code Playgroud) 在 Angular2/TypeScript 环境中,Firebase 文档中的以下代码会出现“EmailPasswordAuthProvider 在类型身份验证中不存在”的错误。
var credential = firebase.auth.EmailPasswordAuthProvider.credential(email, password);
Run Code Online (Sandbox Code Playgroud)
https://firebase.google.com/docs/auth/web/anonymous-auth 将匿名帐户转换为永久帐户
已安装最新的 Firebase 类型版本:firebase@3.0.5
请注意,其他 Firebase 方法工作正常,并且 auth 对象需要打开/关闭括号,例如
firebase.auth().createUserWithEmailAndPassword(email, password);
Run Code Online (Sandbox Code Playgroud)