Angular 是由 Google 维护的用于构建 web 应用程序的完整且自有观点的 framework。与 React(UI 库)或 Vue(渐进式框架)不同,Angular 开箱即用地提供完整的工具包,并围绕 TypeScript 构建。
"完整框架" 的含义
text
React: UI rendering — you add a router, state lib, HTTP client, forms yourself
Angular: includes ALL of it — router, HttpClient, forms, DI, RxJS, CLI, testing
Angular 为路由、HTTP、表单、依赖注入等提供官方、集成的解决方案——这意味着需要做出的第三方选择更少,但代价是学习曲线更陡峭。
一个简单的 Angular 组件
ts
{ } ;
({
: ,
: ,
})
{
count = ;
}
