angular.js README

The project's README from github.com/angular/angular.js. As one markdown file: README.md.

AngularJS CircleCI

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!


AngularJS support has officially ended as of January 2022. See what ending support means and read the end of life announcement.

Visit angular.io for the actively supported 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.

angular.js (angular/angular.js)

Searching Database…

58.5K ·GitHub
archived
这是什么?AngularJS 是一个用于客户端网页应用的 JavaScript 框架,它让浏览器变得更聪明:HTML 就是你的模板语言,并通过额外的语法加以扩展,用来清晰地描述应用的各个组件。
它是用来搭建整个应用的框架,还是一个辅助工具库?是一个框架:它的各个组件被设计为相互关联、协同工作,因此它负责整个应用的结构,而不是提供可以单独挑选使用的工具。
我想看看源代码,需要安装哪些东西?要使用这个代码仓库本身,你需要 Node.js 12.14.1 或更高版本,另外还要安装 Yarn 和 grunt-cli;i18n 测试套件则是在 Jasmine 下运行的。
新项目还适合用这个 Angular 吗?不适合——官方支持已于 2022 年 1 月结束,代码仓库现在也已归档;目前持续维护的后续版本在 angular.io 上。
运行它的操作系统或服务器环境有要求吗?基本没有——它纯粹运行在客户端:框架在访客的浏览器中运行,界面由普通 HTML 定义,因此不需要服务器运行环境,对操作系统也没有要求。
双向数据绑定是怎么工作的?模型(model)一有变化,视图(view)立刻跟着更新,反过来也一样;'scope'(作用域)就像粘合剂,在模型和视图之间传递更新。
指令(directive)是用来做什么的?它让你可以自定义带有额外功能的 HTML 元素和属性,让页面标记更易读——而且指令写好一次后,就能在应用的任何地方重复使用,保持代码 DRY(不重复)。
为什么它把自己的方式叫作 Model-View-Whatever?在经典的 MVC 中,你要自己编写模型、视图和控制器,再把它们手动连起来;而在这里,你只需创建模型和视图,剩下的都由 AngularJS 替你搞定。
在和服务器通信以及页面导航方面,它能给我什么?它用 promise 和 deferred 对象来驯服服务器通信中的异步回调,并且通过 hashbang URL 或 HTML5 pushState 支持客户端导航和深度链接。
Creator
angular
Size
99.4 MB
Stars
58.5K
Updated
CommitApr 12
Age
16y
Commits · 90 Days