日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

angular基本知识学习笔记 - Component的基本概念

發布時間:2023/12/19 编程问答 17 豆豆
生活随笔 收集整理的這篇文章主要介紹了 angular基本知识学习笔记 - Component的基本概念 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

官網地址:https://angular.io/guide/architecture

Angular is a platform and framework for building single-page client applications using HTML and TypeScript. Angular is written in TypeScript. It implements core and optional functionality as a set of TypeScript libraries that you import into your apps.

平臺和框架,用于開發SPA應用,由TypeScript開發, 我們開發的應用導入Angular的TypeScript庫。

The architecture of an Angular application relies on certain fundamental concepts. The basic building blocks are NgModules, which provide a compilation context for components. NgModules collect related code into functional sets; an Angular app is defined by a set of NgModules. An app always has at least a root module that enables bootstrapping, and typically has many more feature modules.

Angular應用的基本組成部分是NgModules, 它是Component的編譯上下文。一個Angular應用至少包含一個Root module,用于實現BootStrap. 除了Root module外,Angular應用包含多個feature module.

Components define views, which are sets of screen elements that Angular can choose among and modify according to your program logic and data.

Component定義了視圖,是一系列screen element的集合。

Components use services, which provide specific functionality not directly related to views. Service providers can be injected into components as dependencies, making your code modular, reusable, and efficient.

Component使用Service,service provider可以通過dependencies的方式被注入,讓Angular代碼更加模塊化,提供可重用性和執行效率。

Modules, components and services are classes that use decorators. These decorators mark their type and provide metadata that tells Angular how to use them.

Modules,Components和Services都是使用了Decorators的classes. 這些Decorators標記了三者的類型,提供了元數據,告知Angular如何使用它們。

The metadata for a component class associates it with a template that defines a view. A template combines ordinary HTML with Angular directives and binding markup that allow Angular to modify the HTML before rendering it for display.

Component類的metadata將其關聯到了一個模板上,該模板定義了一個視圖。此模板將普通的html同Angular的directive和綁定信息的Markup結合了起來,允許Angular在HTML渲染顯示之前動態地修改它。

The metadata for a service class provides the information Angular needs to make it available to components through dependency injection (DI).

Service Class的metadata給Angular提供了足夠的用于依賴注入的信息。

Components定義了若干Views,通過Router service進行navigation管理。

總結

以上是生活随笔為你收集整理的angular基本知识学习笔记 - Component的基本概念的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。