
[英]Is it possible to inherit base class from shared module in Angular without explicit import
在我的项目中有许多“基础”组件类。 此外,该项目将分为几个其他模块,其中我只是想将共享模块用作基类源。 我希望可以在 app.module 中只使用一个简单的import { SharedModule } app.module ,并避免在组件后代中导入许多基组件类,但错误发生了。 (我已经编辑了 ...
[英]Is it possible to inherit base class from shared module in Angular without explicit import
在我的项目中有许多“基础”组件类。 此外,该项目将分为几个其他模块,其中我只是想将共享模块用作基类源。 我希望可以在 app.module 中只使用一个简单的import { SharedModule } app.module ,并避免在组件后代中导入许多基组件类,但错误发生了。 (我已经编辑了 ...
[英]How can I show the arrows of my sorted table according to my sort order in angular?
我有一个表格,我按从大到小或字母顺序排序。 这是我正在排序的部分的 html **这是我在 typescript 部分中的 function ** 我的问题是,当我按“否”排序时,“ID”中的箭头会移动。 我该如何解决这个问题? 当我点击“否”时,我只想让那里的箭头上下移动 footnote:这 ...
[英]When integrating angular/fire 7.5 with angular 15, get error Need to provide options, when not being deployed to hosting via source
我正在将一个应用程序从具有 angular/fire 5.4 的 angular8 移植到具有 angular/fire 7.5 的 angular15。 我将以下内容添加到我的 AppModule 导入部分 但我收到此错误消息:我错过了什么? ...
[英]Angular 15+ No provider for TemplateRef when structural directive used as hostDirective
自 angular 版本 15 以来,有可能将独立指令绑定到组件和指令装饰器。有没有办法将结构指令(注入 templateRef)用作 hostDirective? 这将非常有用,但无论如何我都尝试过,但我总是找不到 TemplateRef 的提供者。 stackblitz 玩 ...
[英]Having karma tests outside src folder in angular 15 project
我在项目根级别的测试文件夹中的 src 文件夹外有业力测试规范文件。 将 angular 从 14 更新到 15 后,karma 需要测试规范文件位于 sourceRoot 在 angular.json 文件中指定的任何文件夹中。 有没有办法告诉 karma 在不更改 angular.json 中的 ...
[英]Angular material 15 matInput type datetime-local is missing native datetime picker
我在mat-form-field中使用类型为"datetime-local"的input字段(带有mat-input ),直到 Angular 14 有一个用于本机日期时间选择器的按钮。 但是自从我升级到 Angular 15 并进行了 Material MDC 迁移后,这个按钮就不见了,而且找不到 ...
[英]How to disable an input FormControl in a Reactive Form with a condition in Angular 15?
我有一个可以输入学生 ID 的表格。 下面是两个输入框,全名和email。当我加载页面时,应该只启用学生ID输入框,而禁用下面的两个输入框。 当我输入学号时,如果有记录,那是唯一一次启用全名和email的输入框。 当我使用 Angular 13 时,它能够为每个输入使用它 但是,我最近更新到 An ...
[英]Angular Reactive Forms ngSubmit not working for single input control
我在使用 Angular 反应式 forms 时遇到问题。 请从官方 Angular reactive forms 文档中检查这个分叉的 Stackblitz示例,名称编辑器形式。 在此示例表单中只有一个input控件。 我在<form>元素上使用ngSubmit并且<button ...
[英]How to filter with pagination efficiently with millions of records in mongodb?
我知道关于这个主题有很多问题。 虽然大多数工作正常,但当有数百万条记录时,它们的性能确实很差。 我有一个包含 10,000,000 条记录的集合。 起初我使用的是 mongoose paginator v2,每页大约需要 8 秒,没有过滤,过滤时需要 25 秒。 与我在谷歌搜索中发现的其他答案相比 ...
[英]Unexpected synthetic property @transitionMessages found with standalone compoent angular 15
我正在将 angular 应用程序迁移到standalone component 。 删除了ngModule和app.module.ts文件主.ts 应用程序组件.scss 自动完成.component.ts 错误 如果我将BrowserAnimationsModule导入到auto-comple ...
[英]Angular Material 15 styles for legacy components
升级到 Angular 后 15 我想使用遗留组件以便之后进行持续迁移。 然而,遗留组件没有全部 styles 并且看起来格式错误。 我使用ng update进行从 Angular 14 到 15 的迁移,并调整主题以使用文档中提到的新方法( https://material.angular.io/ ...
[英]Typescript target warnings after Angular 15 update
我将我的 angular 应用程序更新为 Angular 15。它构建正常 - 除非出现如下警告: TypeScript Angular CLI 将编译器选项“target”和“useDefineForClassFields”分别设置为“ES2022”和“false”。 我的tsconfig.js ...
[英]How to import not standalone components to a standalone component in Angular 14+
我想知道如何将非独立组件导入独立组件,因为非独立组件是在 ngModule 中声明的。 ...
[英]error NG8002: Can't bind to 'matDatepicker' since it isn't a known property of 'input'
我正在使用 Angular 15 实现一个应用程序。我在那里使用 Angular 材料。 我需要添加一个日期选择器,在插入下面的代码片段后出现错误。 错误: 如果您需要更多信息来解决我的问题,请在此处发表评论。 ...
[英]custom Typography not working in angular material 15 after update
此代码非常适合使用 angular 14 在我的整个应用程序中自定义我的排版 将 Angular Material & cdk 更新为 15 时,此错误不断发生: 试过ng generate @angular/material:mdc-migration但它没有特别检测到该文件中的任何问题。 ...
[英]How to set API path during production build in Angular 15
在 Angular 15 中,没有环境文件,因此我们使用 proxy.config 文件为本地开发设置 api 路径,但这在生产构建中不起作用。 下面是 proxy.config.json 文件。 这是我的 package.json 文件。 有人建议使用动态 api 路径设置进行生产构建吗? ...
[英]Angular Material 15 MatSort always undefined
我有一个应用程序,过去 2 年一直在表格中使用 MatSort。 上周我更新到版本 15,现在我发现我的 MatSort 在 AfterViewInit 事件中总是未定义。 我已经确认 MatSortModule 是导入的,所以我不确定为什么它现在坏了。 任何帮助表示赞赏。 下面是我的代码片段,显示 ...
[英]Angular 15: call a function every time a value changes
我们的教授要求我们使用以下组件构建一个简单的电子商务应用程序:客户、订单、菜单(导航栏)和购物车。 我们需要根据从导航栏的下拉菜单中选择的所选客户在前端显示订单,如图所示: 一旦我们 select 一个客户,它的 Id 就被分配给一个变量,然后它被用来根据客户 id 加载订单(多亏了一个名为 g ...
[英]NgOptimizedImage warning
我正在尝试新的 angular 15 功能来提高图像性能,但我遇到了这个警告。 ` 基本上原始图像太宽了,我使用高度和宽度属性使它相对于它的尺寸来说太小了,实际上通过增加高度和宽度警告消失了。 但是我想要那个尺寸的图像,有办法删除那个警告吗? ...
[英]When I lunch chrome debbuger my breakpoints are not visible
IDE 视觉工作室代码 tsconfig.json angular.json 启动.json sourcemap:是的,标准的 chrome 配置,各种各样的东西,还有点是无法到达的。 我想在启动 chrome 断点之前调试我的代码,断点是红色的,但在启动之后它们是灰色的。 ...