前言
命名规范对项目维护是很重要的. Angular 对项目的渗透很大的, 必须做好命名规范, 不然会很乱.
Angular Naming Conversion
InjectionToken = UPPER_SNAKE_CARE
const SERVICE_CONFIG_TOKEN = new InjectionToken('ServiceConfig');
element attribute and property name = camelCase
angular.io example 有 camelCase 和 kebab-case, 不过我看绝大部分都是用 camelCase 居多.
<bank-account bankName="RBC" account-id="4747"></bank-account>
event handler method
如果没有一个具体的名字, 不要放 (click)="onClick()" 放 "handleClick()"
from material
标签:Conversion,进阶,camelCase,InjectionToken,Naming,Angular From: https://www.cnblogs.com/keatkeat/p/17296191.html