javascript Angular JS 是一个库还是一个框架?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32050734/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 14:47:09  来源:igfitidea点击:

Is Angular JS a library or a framework?

javascriptangularjs

提问by Raj

While going through on-line documents about Angular JSin some of the documents they have mentioned Angular JSis not Library it is Frame Workbut in some website they have mentioned Angular JSis Library.

在浏览在线文件时Angular JS,他们提到的一些文件Angular JS不是图书馆,Frame Work但在他们提到的某些网站上Angular JS是图书馆。

Which one is Correct?

哪一个是正确的?

回答by Joe Lloyd

Angular is a framework

Angular 是一个框架

This is a direct quote from the AngularJS site

这是来自AngularJS 站点的直接引用

AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your template language and lets you extend HTML's syntax to express your application's components clearly and succinctly. Angular's data binding and dependency injection eliminate much of the code you would otherwise have to write. And it all happens within the browser, making it an ideal partner with any server technology.

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

This is just the introduction piece but it tells us that AngularJS is definitely a framework and not just a library.

这只是介绍部分,但它告诉我们 AngularJS 绝对是一个框架,而不仅仅是一个库。

Define the differences

定义差异

Libraryperforms specific, well-defined operations.

执行特定的、定义明确的操作。

Frameworkis a skeleton where the application defines the "meat" of the operation by filling out the skeleton. The skeleton still has code to link up the parts but the most important work is done by the application.

框架是一个骨架,其中应用程序通过填充骨架来定义操作的“肉”。骨架仍然有代码来链接各个部分,但最重要的工作是由应用程序完成的。

From thisquestion, please credit the owner.

这个问题,请信用业主。

回答by Twin

Here's a short answer from AngularJS site FAQ

这是AngularJS 站点常见问题解答的简短回答

Is AngularJS a library, framework, plugin or a browser extension? AngularJS fits the definition of a framework the best, even though it's much more lightweight than a typical framework and that's why many confuse it with a library.

AngularJS is 100% JavaScript, 100% client-side and compatible with both desktop and mobile browsers. So it's definitely not a plugin or some other native browser extension.

AngularJS 是一个库、框架、插件还是浏览器扩展?AngularJS 最符合框架的定义,尽管它比典型的框架轻得多,这也是许多人将它与库混淆的原因。

AngularJS 是 100% JavaScript,100% 客户端,并与桌面和移动浏览器兼容。所以它绝对不是插件或其他一些原生浏览器扩展。