小编Man*_*gam的帖子

什么是typescript中的reflect-metadata

什么是反射 - 元数据及其目的?

使用reflect-metadata的语法和目的是什么?

有人可以提供一个例子来更好地理解它吗?

如何反射元数据有助于在typescript中实现装饰器.

typescript reflect-metadata

37
推荐指数
1
解决办法
2万
查看次数

在NgModule中使用forRoot的目的是什么?

在NgModule中使用forRoot的目的是什么?

它与AngularJS 1.x中的提供程序相同吗?

它如何在延迟加载中发挥重要作用?

TIA.

angular-ngmodel angular

34
推荐指数
4
解决办法
2万
查看次数

角度2中隐含的是什么?

如何在angular2 ng-templates中使用以下关键字

  • $implicit角度2模板的目的是什么?
  • let-<attribute>和之间的关系是什么$implicit

ng-template angular

27
推荐指数
3
解决办法
1万
查看次数

angular4中的Renderer2是什么?为什么它比jquery更受欢迎?

我想了解什么是为什么以及为什么Renderer2在角度中用于DOM操作.我们可以在Renderer2或原生javascript中使用丰富而着名的库jQuery吗?使用Renederer2而不是jQuery有什么好处

angular

15
推荐指数
1
解决办法
1万
查看次数

在角度4应用程序中设置路径别名

有没有办法用TypeScript在Angular中设置路径别名,因为放置路径就好了

import { AuthService } from '../../../common/AuthService';
import { ContactService } from '../../../common/ContactService';
Run Code Online (Sandbox Code Playgroud)

记住相对路径URI是非常混乱的.有没有办法创建路径别名并在整个应用程序中使用它们,比如browserify

angular

6
推荐指数
1
解决办法
4239
查看次数

角度为4/5的条件ng-content

嗨,我想要一些有条件的ng-content实现, 例如

<div>
   <ng-content select="[card-icon]"></ng-content>
</div>
<div  #body>
   <div *ngIf="description.children.length;else newDiv">
      <ng-content select="[card-body]"></ng-content>
   </div>
   <div #newDiv>
      <ng-content select="[card-body]"></ng-content>
   </div>
</div>
<div  style="align-self: end;" #description [ngClass]="{'hide':!(description.children.length)}">
<ng-content select="[card-description]" ></ng-content>
</div>
Run Code Online (Sandbox Code Playgroud)

但#newDiv中没有​​投射任何东西.TIA.

angular2-ngcontent angular

5
推荐指数
2
解决办法
5019
查看次数

Angular 15 参考错误:初始化前无法访问“组件 A”

我在相互导入独立组件时遇到一个问题。

成分A。

@Component({
  standalone: true,
  selector: 'app-a',
  templateUrl: './a.component.html',
  styleUrls: ['./a.scss'],
  imports: [
    BComponent
  ]
})
export class AComponent implements OnInit {

}
Run Code Online (Sandbox Code Playgroud)

组分B

@Component({
  standalone: true,
  selector: 'app-b',
  templateUrl: './b.component.html',
  styleUrls: ['./b.scss'],
  imports: [
    AComponent
  ]
})
export class BComponent implements OnInit {

}
Run Code Online (Sandbox Code Playgroud)

早些时候,这个解决方案对我来说工作得很好,因为使用模板访问这些组件。但现在收到此错误。

参考错误:初始化之前无法访问“AComponent”。

高度赞赏上述上下文中的任何帮助。

webpack angular angular-standalone-components

5
推荐指数
1
解决办法
2671
查看次数

索引数据库打开不会触发任何回调

我们正面临一个问题。
当我们尝试打开索引数据库时,不会触发任何回调。
我们正在做以下步骤: 1.
使用以下步骤打开数据库:

request = indexedDB.open(name, 10);
request.onerror = onError;
request.onsuccess = onSuccess;
request.onupgradeneeded = onUpgradeNeeded;
request.onblocked=onBlocked;<br>
Run Code Online (Sandbox Code Playgroud)

2.注意没有触发任何回调。
3.打开 chrome://indexeddb-internals/#,它显示先前的删除数据库正在挂起。

indexeddb

3
推荐指数
1
解决办法
1123
查看次数

如何在 TypeScript 中生成“*.d.ts”?

如何在打字稿中生成“*.d.ts”或创建并导入@types?有没有办法为 jquery 插件或普通 javascript 库创建 d.ts?

types typescript

2
推荐指数
3
解决办法
7461
查看次数