angular-testing-library 相关问题


在react-testing-library中查询font-awesome元素

在我的渲染方法中我有 使用反应测试库...


react-testing-library:无法关闭 MUI Select 的下拉菜单

我有一个 SelectExample.js 从“react”导入 React, { useState }; 从“@mui/material”导入{InputLabel、MenuItem、FormControl、Select、Typography };> 导出默认fu...


Android Studio 由于“内部错误”而无法打开

`内部错误。请参考https://code.google.com/p/android/issues java.lang.AssertionError:无法读取/Users/arnavgupta/Library/Application Support/Google/AndroidStudio2023.1/


在 Windows 10 上的 Python3.8 中安装 charm-crypto 时出错

我不明白这个错误,有谁知道这个错误的含义是什么? (venv) C:\Users dmin\PycharmProjects\Testing>pip install charm-crypto==0.43 收集魅力加密==0.43 使用


如何让运行在 WSL2 上的节点服务器通过 LAN 转发,以便可以通过电话访问?

我尝试过以下方法: https://www.youtube.com/watch?v=yCK3easuYm4 https://medium.com/codemonday/access-wsl-localhost-from-lan-for-mobile-testing-8635697f008 https://superuser.com/questions/1679...


从 Angular 16 转换为 Angular 17 后缺少 SSR 支持

我已将我的项目从 Angular 16 升级到 Angular 17。但是,我目前没有收到服务器端渲染 (SSR) 的支持。从 Angular 16 迁移后,Angular 是否提供 SSR 支持...


passport-azure-ad / msal.js 和动态作用域

Azure AD v2.0 讨论了动态同意的优点之一 (https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/api-scopes#request-dynamic-scopes- for-增量-c...


更改每个案例的 UI 测试区域

我正在使用 swift-snapshot-testing 库进行快照测试。对我来说,使用不同的本地化进行所有测试以在文本更改时检查所有 UI 非常重要。 例如,t...


Angular CLI 版本与 Angular Core 版本之间的兼容性?

有什么方法可以知道要安装哪个与我的 Angular Core 版本兼容的 Angular CLI 版本?他们完全独立吗? 使用 Core v5.2.8 开发现有的 Angular 应用程序...


Python 多处理 - 如何将 kwargs 传递给函数?

如何使用 Python 的多重处理将字典传递给函数?文档:https://docs.python.org/3.4/library/multiprocessing.html#reference 说要传递字典,但我保留了...


Angular 17 中的 NG 块 UI

我尝试在 Angular 17 中使用 NG Block UI 并收到此错误 ng block ui error in Angular 17 知道这个模块在 Angular 17 中如何工作吗? 提前致谢 我使用 npm i ng-


在这种情况下有“distinct-values()”的解决方法吗?

首次海报和 XPath 初学者。我希望你能帮助我解决我遇到的这个 XPath 问题。这是我的文件的简化示例。 第一次海报和 XPath 初学者。我希望你能帮助我解决我遇到的这个 XPath 问题。这是我的文件的简化示例。 <town> <library> <section> <book> <title>ABC </title> </book> <book> <title>DEF </title> </book> </section> <section> <book> <title>ABC </title> </book> <book> <title>DEF </title> </book> </section> </library> <library> <section> <book> <title>ABC </title> </book> <book> <title>DEF </title> </book> </section> <section> <book> <title>ABC </title> </book> <book> <title>DEF </title> </book> <book> <title>GHI </title> </book> </section> </library> </town> 我试图通过 XPath 获得的是具有唯一“标题”的“book”元素,但在两个“library”元素中都是唯一的,而不是在根“town”节点中唯一的。 所以,根据我上面的例子,我期望得到第一个“library”的第一个“ABC”和第一个“DEF”,以及第一个“ABC”,第一个“DEF”和第一个“GHI”第二个“图书馆”。 distinct-values(//library[1]//book | //library[2]//book) 这可行,但我无法使用它,因为我需要使用 XPath 的 CMS 无法识别该功能... //library//book[not(./title = preceding::*/title)] 这不会选择第二个“库”中的第一个“ABC”和第一个“DEF”,我不明白为什么。有没有办法限制“前一个”轴的范围,使其停止在自己的“库”元素处? 如果有人理解我想要实现的目标,我将非常感谢任何帮助! 看来您使用的CMS仅支持XPath 1.0。首先游说他们改变这一点 - XPath 1.0 于 2007 年被 2.0 取代,现在应该已经成为历史。 这在单个 XPath 1.0 表达式中很难(也许不可能)完成。 (很难证明任何事情都是不可能的,但是你可以从 XPath 1.0 不是关系完备的前提开始,即它不支持整个一阶谓词演算;特别是它不支持范围变量.) 不幸的是,我不知道您还有哪些其他选择。


“forecast”包的安装具有非零退出状态

在 CentOS 上使用 R 版本 3.2.3 (2015-12-10) 我正在尝试 install.packages('forecast') 我明白了: install.packages('预测') 将软件包安装到“/usr/lib64/R/library”中 (因为“lib”是


将 EdgeList 作为 unordered_set 存储在 Boost Graph Library 上

我正在重现一个科学实验,我需要将图的边集存储为无序集。我正在尝试使用 BGL adjacency_graph,我认为最后一个参数是 hash_...


Angular Material v17:缺少“MatFormFieldAppearance”中的“遗产”

在 Angular Material v14 中,MatFormFieldAppearance 提供了传统、标准、填充和轮廓值。 类型 MatFormFieldAppearance = '旧版' | '标准' | '填充' | '大纲'; 然而,在 Angular


Angular“ng 生成组件”复制组件

由于某种原因,自从从 Angular 13 升级到 Angular 15 后,当我输入: ng g c 某些组件 Angular 复制组件,创建重复文件。这种情况 100% 都会发生。第二次...


Lottie 动画文件未显示

我试图在我的项目中添加很多动画,但它根本没有显示在浏览器中。我可以检查元素并在 head 标签中查看 BODYMOVING LIBRARY,以及下面的脚本...


Homebrew 无法安装 SDL_image 和 SDL_ttf(macos 版本 10.13.6 High Sierra)

当我尝试使用自制程序安装时 酿造安装sdl2_ttf 这就是我所拥有的 /Users/mac/Library/Logs/Homebrew/ninja/01.python3 的最后 15 行: 运行时: clang++ -MMD -MT build/build...


如何使用 Angular 服务创建 nx 库

我有几个 Angular 应用程序在 nx 工作区中运行。所有这些应用程序都使用 Angular Material 对话框。为此,我通常创建这样的 Angular 服务: 导入 { 管理组件 }


Angular-NG8001 未知元素错误。怎么解决?

我的 Angular 项目有问题。我有一个项目结构:应用程序结构。在我的 app.module.ts 中,代码如下: 从'@angular/core'导入{NgModule}; 从'@


Angular 项目不适用于@babylonjs/viewer

我在全球安装了@Angular/[email protected]。我使用命令行“ng new BabylonTest --routing false --style css --skip-git --skip-tests”创建了一个 Angular 项目。 CD 到文件夹“Babyl...


使用模块联盟进行 Angular 升级 - “集合没有原理图。”

我正在将一组 Angular 应用程序从 v12 升级到 v16,它们使用模块联合和 Angular Architects 的模块联合插件。 成功升级每个应用程序的 Angular 版本后...


Node Sass 版本 9.0.0 与 ^4.0.0 不兼容

我的应用程序中没有安装node-sass或sass包。但我一直收到这个错误 ./src/scss/styles.scss 中的错误(./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plu...


放大init UnauthorizedException

我正在使用以下文档学习放大器 https://docs.amplify.aws/angular/start/getting-started/installation/ https://docs.amplify.aws/angular/start/getting-started/setup/ 但同时


登录后,使用 angular-oauth2-oidc 时,hasValidAccessToken 始终为 true

我已经使用 Angular 12.2 实现了 angular-oauth-oidc (版本 12.1.0)。我使用 Keycloak 作为 SSO 登录没有问题,但我在库中遇到了奇怪的行为。 每次,之后...


通过Angular到Springboot访问POST失败但GET成功,Postman适用于GET和POST

我正在使用示例 Angular 应用程序来测试 Okta 与 springboot 应用程序的集成。 前端示例:https://github.com/okta-samples/okta-angular-sample 我有一个带有


类型“string”无法分配给类型“FormGroup<any>”Angular 14 错误

我是一名初学者 Angular 开发人员,我正在使用本教程构建一个 todoList 应用程序 -> https://www.youtube.com/watch?v=WTn2nVphSl8 它是使用 Angular 13 完成的。我遇到错误的是我...


Angular Material 17 独立组件中没有 DateAdapter 的提供者

我有一个带有 Angular 17 应用程序的 nx 项目,并尝试使用带有材料 17.0.4 的 Angular 材料日期选择器。但我明白了 NullInjectorError:没有 DateAdapter 的提供者! 错误。组件...


应用程序无法识别手势,例如在 Angular 11 中使用 Hammer.JS 进行平移

我无法在使用 Hammer.JS 的 Angular 应用程序中识别任何手势,例如滑动、平移。它的设置是这样的: 包.json: “@角度/核心”:“11.0.5”, “@Angular/platform-br...


如何让新的 Angular 17 项目运行?

全新安装 Nodejs (20.10.0) 和 Angular (17.0.8)。新项目(“ng new Default”),没有文件更改。 “ngserve”没有错误,但浏览器控制台显示: main.ts:5 错误


为什么我的应用程序根目录在 Angular 中不是 100% 高度?

这是我的第一个 Angular 项目,我对 Web 开发还很陌生。我正在使用 Angular 17.0.9。 我希望我的应用程序为 100%,但应用程序根标签始终是可能的最小高度 当你...


Angular Material 5 深色主题未应用于机身

我创建了一个“自定义”主题(使用 https://material.angular.io/guide/theming 上的主题文档,这非常糟糕),如下所示: @import '~@angular/material/theming'; @包括 mat-cor...


Angular 17:fileReplacements 不替换文件

我有一个 C#/Angular 17 SPA 项目,在具有多个部署槽的 Azure 应用服务上的 Docker 容器中运行。基本上,生产槽加载标记为“latest-prod”的图像......


Angular 12:Firebase 模块未正确提供(?)

第一次使用Firebase,所以我不知道发生了什么。我没有修改使用 ng add @angular/fire 获得的配置,所以我的 AppModule 中的内容是: @NgModule({ 声明:[


如何将 swiper 11.0.5 元素与 Angular 17 一起使用

在 Angular 17 中,一切都是独立组件,并且没有 app.module.ts 文件。那么,我们把这段代码放在哪里, 从“swiper/element”导入{register}; 登记(); 我正在...


NG8001:“app-welcome”不是已知元素:

我的 Angular 应用程序遇到问题,收到错误 8001。我不知道如何处理它。谁能帮我这个?谢谢你! 应用程序组件.html {{标题}}&l... 我的 Angular 应用程序遇到问题,收到错误 8001。我不知道如何处理它。谁能帮我这个?谢谢! app.component.html <h1>{{ title }}</h1> <p>Congratulations! Your app is running. 🎉</p> <app-welcome></app-welcome> app.component.ts import { Component } from '@angular/core'; import { CommonModule } from '@angular/common'; import { RouterOutlet } from '@angular/router'; @Component({ selector: 'app-root', standalone: true, imports: [CommonModule, RouterOutlet], templateUrl: './app.component.html', styleUrl: './app.component.css' }) export class AppComponent { title = 'XYZCARS'; } welcome.component.ts import { Component } from '@angular/core'; @Component({ selector: 'app-welcome', templateUrl: './welcome.component.html', styleUrl: './welcome.component.css' }) export class WelcomeComponent { car = 'toyota'; } 我的项目最初没有 app.module.ts 文件。我自己添加了它并根据网上找到的一些信息进行了配置,但问题仍然存在并且仍未解决。谁能帮我解决这个问题吗? app.module.ts import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { WelcomeComponent } from './welcome/welcome.component'; import { AppComponent } from './app.component'; @NgModule({ declarations: [ AppComponent, WelcomeComponent ], imports: [ BrowserModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { } 如果您正在 Angular 17 中创建项目->使用这些命令 ng app --no-standalone 然后你就得到了 app.module.ts 文件。


在 Angular 的输入标签中使用值

我目前正在开发 Angular 前端。 我想使用由我正在合作的团队创建的组件,该组件用于在表单中创建输入文本。 该组件的 .html...


当element在element上使用迭代变量时如何重构ngFor?

我有这个 {{ dt }} 我想重构为 Angular v17


Angular 复选框:更改未正确反映

我在 Angular 项目中面临一个问题,其中选项表单中有多个复选框。问题是有时复选框中的更改无法正确反映。这是相关内容...


Angular:如何将管道与位置结合使用

在 Angular 中,位置是“应用程序可以用来与浏览器 URL 交互的服务”。 它提供了一个 getState() 方法,该方法提供“位置历史记录的当前状态&


选中/取消选中 mat-checkbox 未正确返回 true 或 false

我正在使用 Angular 15 和 Angular Material 14,下面是我用来显示复选框列表的 HTML 代码 我正在 Angular 15 和 Angular Material 14 工作,下面是我用来显示复选框列表的 HTML 代码 <div *ngFor="let control of checkboxArray.controls;let i = index" > <mat-checkbox [formControl]="control" (input)="validateInputs(notificationForm)" [checked]="control.value" (change)="control.checked=$event.checked;onCheckedChange(i);"> {{ checkboxItems[i].name }} </mat-checkbox> </div> 下面是Angular中onCheckedChange函数的代码 onCheckedChange(index: number) { this.sortCheckboxArray(); const checkboxItem = this.checkboxItems[index]; const control = this.checkboxArray.at(index); if (control) { if (control.value) { this.lists.push(checkboxItem.id.toString()); } else { this.lists.pop(checkboxItem.id.toString()); } } this.updateSubscriberGroupsCount(); this.cdr.detectChanges(); } 当我选中复选框时,在这个 onCheckedChange 函数中,control.value 始终返回 false。哪里出了问题?无法理解.. 这是一个工作版本,复选框逻辑工作正常,希望有帮助! 我们需要使用control.value获取表单组,但我们还需要访问内部表单控件,然后获取复选框值! import { CommonModule } from '@angular/common'; import { Component } from '@angular/core'; import { FormArray, FormControl, FormGroup, ReactiveFormsModule, } from '@angular/forms'; import { bootstrapApplication } from '@angular/platform-browser'; import 'zone.js'; import { MatCheckboxModule } from '@angular/material/checkbox'; @Component({ selector: 'app-root', standalone: true, imports: [CommonModule, ReactiveFormsModule, MatCheckboxModule], template: ` <form [formGroup]="form"> <div formArrayName="array"> <div *ngFor="let control of checkboxArray.controls;let i = index" [formGroupName]="i"> <mat-checkbox formControlName="test" style="margin-bottom: 15px;" (change)="onCheckedChange(i);"> {{ checkboxItems[i].name }} </mat-checkbox> </div> </div> </form> `, }) export class App { name = 'Angular'; form = new FormGroup({ array: new FormArray([]), }); lists = []; checkboxItems: any = []; ngOnInit() { this.add(); this.add(); this.add(); } add() { this.checkboxArray.push( new FormGroup({ test: new FormControl(false), }) ); this.checkboxItems.push({ name: 'test' }); } get checkboxArray() { return this.form.get('array') as FormArray; } onCheckedChange(index: number) { // this.sortCheckboxArray(); // const checkboxItem = this.checkboxItems[index]; const control = this.checkboxArray.at(index); if (control) { if (control.value.test) { console.log('checked'); // this.lists.push(checkboxItem.id.toString()); } else { console.log('not checked'); // this.lists.pop(checkboxItem.id.toString()); } } // this.updateSubscriberGroupsCount(); // this.cdr.detectChanges(); } } bootstrapApplication(App); 堆栈闪电战


Angular 中的 JavaScript 函数“未定义”错误

我正在尝试让 Angular 17 项目正常运行。我正在使用 Bootstrap (5),并尝试让 datePicker 工作。这需要一些 JavaScript 代码,但我无法使用这些代码。我已经关注了...


@types/ws 尝试从角度 12 更新到角度 13 时出现错误

我已将我的项目从 Angular 12 更新为 Angular 13,但遇到此错误: 错误:node_modules/@types/ws/index.d.ts:328:18 - 错误 TS2315:类型“服务器”不是通用的。 328服务器?:


如何在 Angular 17 中添加插值而不转义 URL 编码?

我想添加一个routeLink,其中使用Angular插值在字符串中定义完整的URL值,但是当页面执行时,它会转义URL。 预期:http://localhost:4200/books?page=3&sort=...


office 插件中的 Redux DevTools

我正在开发一个使用 Angular 15 的 Excel 插件,在 Angular 应用程序中,我刚刚添加了 @ngrx/store。我也将开发工具添加到了模块中。我注意到 Excel 使用 Edge 来运行该加载项。


如何在 Angular Material 2 中构建自定义组件

是否有任何标准方法可以在 Angular Material 2 之上构建自己的组件或扩展现有组件。 之前我使用过 Sencha/ExtJS 框架,构建自己的框架非常简单


Angular 10 ssr 不适用于请求 API

在一个项目中,我安装了 SSR 的 Angular Universal,并使用 Firebase 托管和功能进行部署。 对于静态文本和图像资源,我在生产中获取了用于 SEO 的内容,但是对于...


如何在Angular单元测试中正确获取子组件实例?

我正在 Angular 中用 karma 编写单元测试,但我正在努力解决奇怪的问题。我正在尝试测试 source-roll-history.dialog.ts 内部的 app-source-roll-history-form 的输出取消....


有没有办法使用角度材料拖放来调整大小

我正在使用 Angular 和 Material 创建一个 Web 应用程序,我希望能够拖放和调整我的部分的大小。有没有办法使用 Angular Material 拖放 CDK 来完成?


将 Angular Material 从 16 迁移到 17 时出现目录错误

我正在尝试运行 Angular Material 迁移工具以从 16 迁移到 17,但收到一条错误消息,指出目录必须是字符串。 JSON 显示它是错误的。这不是提示,a...


© www.soinside.com 2019 - 2024. All rights reserved.