我会阅读有关打字稿的内容class,abstract class并且确实发现了一些非常有趣的东西。
Typescript allows us to implement classes.
我什至创建了一个stackblitz项目来测试它。
无论如何,我已经在这里找到了一般差异,以及它在此处的打字稿中的行为是什么。
为什么打字稿允许的话,如果在其他非常流行的语言(Java,C#,...),这是“禁止”?此功能是否还有其他重要应用?
我正在查看ECMA-262语法,以获得下一个代码的定义:
const v = (! + [] + []);
const c = (false + []);
console.log(v);
console.log(c);Run Code Online (Sandbox Code Playgroud)
什么是它?
到目前为止,我没有找到任何有用的信息,是否有人知道为什么它会给出这些结果或有关于它的参考?
我正在使用有角度的材料制作侧边栏菜单。我没有找到根据某些组件属性更改按钮颜色的方法。
我已经阅读了文档:https : //material.angular.io/components/button/overview
关于主题,它只说:
Buttons can be colored in terms of the current theme using the color property to set the background color to primary, accent, or warn.
这是我的代码:
<button
       *ngFor="let link of links; let i = index"
       mat-raised-button
       color="primary"
       (click)="selectedIndex = i"
       [routerLink]="link.routerLink">
</button>
Run Code Online (Sandbox Code Playgroud)
我什至不知道是否有可能,但我正在寻找这样的东西:
<button
       *ngFor="let link of links; let i = index"
       mat-raised-button
       (click)="selectedIndex = i"
       [color]="selectedIndex === i ? primary : warm"
       [routerLink]="link.routerLink">
</button>
Run Code Online (Sandbox Code Playgroud) angular ×1
arrays ×1
class ×1
ecmascript-6 ×1
extends ×1
implements ×1
interface ×1
javascript ×1
typescript ×1