AngularJS

AngularJS - Web应用程序增强的HTML!(AngularJS - HTML enhanced for web apps! )

Github星跟蹤圖

AngularJS是动态Web应用程序的结构框架。它允许您使用HTML作为模板语言,并允许您扩展HTML的语法,以清晰简洁地表达应用程序的组件。 AngularJS的数据绑定和依赖注入消除了您将要写入的大部分代码。这一切都发生在浏览器中,使其成为任何服务器技术的理想合作伙伴。

AngularJS可让您编写客户端Web应用程序,就像您拥有更智能的浏览器一样。 它允许您使用好的旧HTML(或HAML,Jade/Pug和朋友!)作为模板语言,并允许您扩展HTML的语法,以清晰、简洁地表达应用程序的组件。 它可以通过双向数据绑定自动将UI(视图)与JavaScript对象(模型)的数据进行同步。 为了帮助您更好地构建您的应用程序并使其易于测试,AngularJS教导浏览器如何进行依赖注入和反转控制。

它还有助于服务器端通信,使用承诺和延迟来控制异步回调,并且它使客户端导航和与hashbang url或HTML5 pushState的深度链接成为一块蛋糕。 最好的? 它使开发有趣!

AngularJS是下一代框架,每个组件都被设计成与其他组件相互连接,就像一台运转良好的机器一样。AngularJS是JavaScript MVC,事半功倍,做得很好。

概覽

名稱與所有者angular/angular.js
主編程語言JavaScript
編程語言JavaScript (語言數: 5)
平台
許可證MIT License
發布數209
最新版本名稱v1.8.3 (發布於 2022-04-07 15:05:59)
第一版名稱v0.9.0 (發布於 2010-10-20 15:53:35)
創建於2010-01-06 00:34:37
推送於2024-04-12 17:43:16
最后一次提交2024-04-12 13:43:13
星數58.9k
關注者數3.8k
派生數27.6k
提交數9.1k
已啟用問題?
問題數9037
打開的問題數391
拉請求數790
打開的拉請求數73
關閉的拉請求數7137
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?

AngularJS Build Status

AngularJS lets you write client-side web applications as if you had a smarter browser. It lets you
use good old HTML (or HAML, Jade/Pug and friends!) as your template language and lets you extend HTML’s
syntax to express your application’s components clearly and succinctly. It automatically
synchronizes data from your UI (view) with your JavaScript objects (model) through 2-way data
binding. To help you structure your application better and make it easy to test, AngularJS teaches
the browser how to do dependency injection and inversion of control.

It also helps with server-side communication, taming async callbacks with promises and deferred objects,
and it makes client-side navigation and deep linking with hashbang urls or HTML5 pushState a
piece of cake. Best of all? It makes development fun!


On July 1, 2018 AngularJS entered a 3 year Long Term Support period: Find out more

Looking for the new Angular? Go here: https://github.com/angular/angular


Documentation

Go to https://docs.angularjs.org

Contribute

We've set up a separate document for our
contribution guidelines.

Develop

We've set up a separate document for
developers.

Analytics

What to use AngularJS for and when to use it

AngularJS is the next generation framework where each component is designed to work with every other
component in an interconnected way like a well-oiled machine. AngularJS is JavaScript MVC made easy
and done right. (Well it is not really MVC, read on, to understand what this means.)

MVC, no, MV* done the right way!

MVC, short for Model-View-Controller, is a design pattern, i.e. how the code should be organized and
how the different parts of an application separated for proper readability and debugging. Model is
the data and the database. View is the user interface and what the user sees. Controller is the main
link between Model and View. These are the three pillars of major programming frameworks present on
the market today. On the other hand AngularJS works on MV*, short for Model-View-Whatever. The
Whatever is AngularJS's way of telling that you may create any kind of linking between the Model
and the View here.

Unlike other frameworks in any programming language, where MVC, the three separate components, each
one has to be written and then connected by the programmer, AngularJS helps the programmer by asking
him/her to just create these and everything else will be taken care of by AngularJS.

Interconnection with HTML at the root level

AngularJS uses HTML to define the user's interface. AngularJS also enables the programmer to write
new HTML tags (AngularJS Directives) and increase the readability and understandability of the HTML
code. Directives are AngularJS’s way of bringing additional functionality to HTML. Directives
achieve this by enabling us to invent our own HTML elements. This also helps in making the code DRY
(Don't Repeat Yourself), which means once created, a new directive can be used anywhere within the
application.

HTML is also used to determine the wiring of the app. Special attributes in the HTML determine where
to load the app, which components or controllers to use for each element, etc. We specify "what"
gets loaded, but not "how". This declarative approach greatly simplifies app development in a sort
of WYSIWYG way. Rather than spending time on how the program flows and orchestrating the various
moving parts, we simply define what we want and AngularJS will take care of the dependencies.

Data Handling made simple

Data and Data Models in AngularJS are plain JavaScript objects and one can add and change properties
directly on it and loop over objects and arrays at will.

Two-way Data Binding

One of AngularJS's strongest features. Two-way Data Binding means that if something changes in the
Model, the change gets reflected in the View instantaneously, and the same happens the other way
around. This is also referred to as Reactive Programming, i.e. suppose a = b + c is being
programmed and after this, if the value of b and/or c is changed then the value of a will be
automatically updated to reflect the change. AngularJS uses its "scopes" as a glue between the Model
and View and makes these updates in one available for the other.

Less Written Code and Easily Maintainable Code

Everything in AngularJS is created to enable the programmer to end up writing less code that is
easily maintainable and readable by any other new person on the team. Believe it or not, one can
write a complete working two-way data binded application in less than 10 lines of code. Try and see
for yourself!

Testing Ready

AngularJS has Dependency Injection, i.e. it takes care of providing all the necessary dependencies
to its controllers and services whenever required. This helps in making the AngularJS code ready for
unit testing by making use of mock dependencies created and injected. This makes AngularJS more
modular and easily testable thus in turn helping a team create more robust applications.

去到頂部