当我在我的 angular 应用程序中进行验证时,我遇到了这个错误:
src/app/register/register.component.ts:45:39 - error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'AbstractControl[] | { [key: string]: AbstractControl; }'.
No index signature with a parameter of type 'string' was found on type 'AbstractControl[] | { [key: string]: AbstractControl; }'.
45 return control?.value === control?.parent?.controls[matchTo].value ? null : {isMatching: true}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Run Code Online (Sandbox Code Playgroud)
这是错误来自的方法:
matchValues(matchTo: string): ValidatorFn {
return (control: AbstractControl) => {
return control?.value === control?.parent?.controls[matchTo].value ? null : {isMatching: …Run Code Online (Sandbox Code Playgroud) 我知道有几篇关于使用 AJAX 删除的 405 错误的帖子。但是,我发现的帖子中的所有解决方案都不适合我。
我有一个表,其中显示了我的数据库表中的所有产品。在每一行都有一个删除按钮来删除产品,如下所示:
{!! Form::open(['method' => 'DELETE', 'route' => ['slider.destroy', $slide->id]]) !!}
<button type="button" class="deleteproductModal btn btn-xs btn-default btn-flat"
data-toggle="modal"
data-product_token="{{ csrf_token() }}"
data-product_name="{{ $slide->title_slider }}"
data-product_destroy_route="{{ route('slider.destroy', $slide->id) }}">
<i class="fa fa-trash"></i>
</button>
{!! Form::close() !!}
Run Code Online (Sandbox Code Playgroud)
单击按钮时,将执行以下 javascript 调用控制器中的 destroy 方法以从数据库中删除产品:
$('button.deleteproductModal').click(function()
{
var productRoute = $(this).attr("data-product_destroy_route");
var productName = $(this).attr("data-product_name");
var productToken = $(this).attr("data-product_token");
deleteproduct(productRoute, productToken, productName);
});
function deleteproduct(productRoute, productToken, productName)
{
swal({
title: "Window product Deletion",
text: "Are you absolutely sure you want …Run Code Online (Sandbox Code Playgroud) 我在 ubuntu 中的 xampp 工作得很好,直到它突然停止工作,当我重新安装它并通过命令行启动它时,它向我显示了这个错误“opt/lampp/bin/mysql.server: 260: kill: No such process ”启动后。
我的 localhost/phpmyadmin 也面临这个错误
MySQL said: Documentation
Cannot connect: invalid settings.
mysqli_real_connect(): (HY000/2002): No such file or directory
Connection for controluser as defined in your configuration failed.
mysqli_real_connect(): (HY000/2002): No such file or directory
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by …Run Code Online (Sandbox Code Playgroud)