我是棱角分明的新手.
我使用了包ng2-bootstrap使用了bootstrap模式.
我的查看文件是
<div bsModal #lgModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title pull-left">Area Master</h4>
<button type="button" class="close pull-right" (click)="lgModal.hide();" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
Modal Content here...
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Add</button>
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我需要知道如何从组件(类型脚本文件)中显示/隐藏此模式.
输入脚本文件是
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import { Router } from '@angular/router';
import { FormGroup, Validators, FormBuilder, FormControl } from '@angular/forms';
import { Area …Run Code Online (Sandbox Code Playgroud) 我正在尝试通过ruby SDK使用 AWS Cognito 服务进行用户身份验证。
我可以使用这些方法进行注册、确认注册过程
resp = client.sign_up({ client_id: "ClientIdType",
secret_hash: "SecretHashType",
username: "UsernameType",
password: "PasswordType",
user_attributes: [{ name:"AttributeNameType",
value: "AttributeValueType",
}],
validation_data: [{
name: "AttributeNameType",
value: "AttributeValueType",
}]
})
Run Code Online (Sandbox Code Playgroud)
并使用确认注册
resp = client.confirm_sign_up({client_id: "ClientIdType",
secret_hash: "SecretHashType",
username: "UsernameType",
confirmation_code: "ConfirmationCodeType"
})
Run Code Online (Sandbox Code Playgroud)
但是,在尝试通过 initiate_auth 登录用户时,我收到错误Missing required parameter SRP_A
cog_provider.initiate_auth({client_id: "xxxxxxxxx", auth_parameters: { username: "xxx", password: "xxx"}, auth_flow: "USER_SRP_AUTH"})
Run Code Online (Sandbox Code Playgroud)
SRP_A 表示在哪里可以找到它。
我已经搜索过这个问题,建议使用admin_initiate_auth登录用户的方法,我认为这不是最佳实践。
ruby ruby-on-rails amazon-web-services srp-protocol amazon-cognito
我正在使用 rspec 或测试 API。同时我使用子弹宝石来识别 N+1 查询问题。
Bullet gem 在除 test(rspec) 之外的所有其他环境中都可以正常工作
子弹宝石表示
Bullet::Notification::UnoptimizedQueryError: user: karthik
Unused Eager Loading detected
Run Code Online (Sandbox Code Playgroud)
并停止运行测试进程。
如果我删除相应的预先加载它工作正常,但在开发的服务器日志中
user: karthik
/api/v1/grades
N+1 Query detected
Grade => [:grade_details]
Add to your finder: :includes => [:grade_details]
N+1 Query method call stack
Run Code Online (Sandbox Code Playgroud)
我还提到了https://github.com/flyerhzm/bullet/issues/115 但我也无法得到直接的答案
我有以下方法
def add_5(a)
a + 5
end
Run Code Online (Sandbox Code Playgroud)
当我调用add_5(5)时,它返回10
对于该方法
def add_5(a)
a + 5
a + 5 if false
end
Run Code Online (Sandbox Code Playgroud)
当我调用add_5(5)时,它返回nil.我只需要知道为什么会这样