📜  Angular 4 和 Angular 5 的区别

📅  最后修改于: 2021-09-15 01:12:17             🧑  作者: Mango

Angular 4: Angular 4 是在 AngularJS 正式发布 5 年后推出的。 Angular 4 是一个基于 JavaScript 的开源框架,用于使用 JavaScript、HTML 和 TypeScript 构建 Web 应用程序,TypeScript 是 JavaScript 的超集。 Angular 4 于 2017 年 3 月推出,支持较早的 TypeScript 版本,例如 TypeScript 2.2 和 2.1。

Angular 5: Angular 5 是 Angular 4 之后的 AngularJS 的更新版本,开发用于更快地创建应用程序,因为它删除了不必要的代码。 Angular 5 更先进,有自己的一套功能,如构建优化器、编译器改进和代码共享功能。它于2017年11月1日推出。

Angular 4 和 Angular 5 的区别:

S.No. Angular 4 Angular 5
1. Angular 4 was launched in the March 2017. Angular 5 was launched in the November 2017.
2. Angular 4 supports earlier TypeScript versions such as TypeScript 2.2 and 2.1. Angular 5 only supports TypeScript 2.5.
3. Angular 4 does not provide the option to restrict the unneeded white spaces, tabs and newlines. While Angular 5 provides the option to restrict tabs, whitespaces and newlines.
4. Angular 4 does not have the feature of build optimizer. Angular 5 has the feature of build optimizer.
5. Angular 4 does not provide support for multiple naming scheme. Angular 5 provides support of multiple names for both directives and components.
6. In Angular 4, traditional approach is used for tracking life cycle events. In Angular 5, developer can track the route of life cycle events with new router which provides a more realistic tracking.