我真的是Android的新手,我正在尝试实现SMS Retriever API,以便在我的应用中使用OTP。
我正在遵循此指南:https : //developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string
不幸的是,我陷入了“ 计算应用程序的哈希字符串 ”部分
我在这里引用指南部分,并在每个问题下方引用我的问题:
以小写的十六进制字符串形式获取应用的公钥证书。例如,要从密钥库获取十六进制字符串,请键入以下命令
keytool -alias MyAndroidKey -exportcert -keystore MyProduction.keystore | xxd -p | tr -d "[:space:]"
Run Code Online (Sandbox Code Playgroud)在哪里可以找到“公钥证书”,我应该在哪里运行此命令?
SHA-256是什么,计算它意味着什么?
无法理解,我应该在这里做什么?
在使用ng-for循环时,我想将类添加到item,只有当项目的id存在于某些其他对象列表中时.
我试过这样的事情:
<div *ngFor="let p of products" [class.Flag]="favoriteList.some((item)=> item.Id == p.id)"> </div>
Run Code Online (Sandbox Code Playgroud)
或这个:
<div *ngFor="let p of products" [ngClass]="favoriteList.some((item)=> item.Id == p.id) ? 'Flag': ''"> </div>
Run Code Online (Sandbox Code Playgroud)
但它没有编译.
请注意,"favoriteList"可能会在 "产品" 之后加载到页面.
知道我该怎么办?
谢谢!
我有一个 Angular 5 站点,它从 REST API 接收数据,例如每个页面向 API 发出 1-4 个请求,发生的情况是请求有时需要很长时间(有时不需要)。
现在,所有请求都使用Observable在一个函数中执行:
return this.http.post(url, {headers: this.header})
.map(res => res.json())
.catch(this.handleError)
Run Code Online (Sandbox Code Playgroud)
我的问题是 - 是否因为正在使用 Observable 而导致缓慢的过程发生?会承诺将是更好的性能?或者在性能上下文中 Observable 和 Promise 之间没有区别吗?
在我将 Angular 项目的版本从 5 更新到 7 之后,我遇到了很多漏洞,需要修复它——我运行了“npm 审计”中建议的所有命令,所有漏洞都得到了修复。
但是现在当我运行时:
ng serve
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
node_modules/protractor/built/ptor.d.ts(33,17) 中的错误:错误 TS2307:找不到模块“./selenium-webdriver/lib/input”。
如果我进入错误源,我可以看到问题行:
// node_modules/protractor/built/ptor.d.ts
Key: import("./selenium-webdriver/lib/input").IKey;
Run Code Online (Sandbox Code Playgroud)
如果我将行更改为:
Key: import("../../selenium-webdriver/lib/input").IKey;
Run Code Online (Sandbox Code Playgroud)
它修复了错误。
我想这是一个版本问题,但现在仍有待找出正确的版本。
这是我的 package.json 文件:
{
"name": "test",
"version": "1.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular-devkit/core": "7.3.6",
"@angular/animations": "7.2.11",
"@angular/common": "7.2.11",
"@angular/compiler": "7.2.11",
"@angular/core": "7.2.11",
"@angular/forms": "7.2.11",
"@angular/http": "7.2.11",
"@angular/platform-browser": "7.2.11",
"@angular/platform-browser-dynamic": "7.2.11",
"@angular/router": …Run Code Online (Sandbox Code Playgroud) 我想从<a>标签中调用类型脚本组件中的函数,使用href如下:
<a href="fun()" ></a>
Run Code Online (Sandbox Code Playgroud)
有可能吗?请注意,我只需要这种方式.使用"click".event对我的情况没有帮助..
我已经尝试了这个:
<a href="javascript:fun()">
Run Code Online (Sandbox Code Playgroud)
但它不起作用.
谢谢!
angular ×4
android ×1
html ×1
javascript ×1
ng-class ×1
node.js ×1
npm ×1
rxjs ×1
typescript ×1