Sitemap
codeburst

Bursts of code to power through your day. Web Development articles, tutorials, and news.

Angular Evolution :

5 min readSep 5, 2018

--

Before gonna start the differences between angular versions. Let us discuss some simple question. It may be useful for New Bees.

What is Angular?

Angular is a JavaScript open-source front-end web application framework. It is primarily sustained by Google together with an extended community of people and companies, to approach many of the challenges faced when developing a single page, cross-platform, performant applications. It is fully extensible and works well with other libraries. For additional details visit their official documentation pages.

Press enter or click to view image in full size
Angular

What is a single page application?

A single-page application is a web application or website that interacts with the user by dynamically rewriting the current page rather than loading entire new pages from a server.

Example single page application

What is the cross-platform application?

For a piece of software to be considered cross-platform, it must be able to function on more than one computer architecture or operating system. Developing such a program can be a time-consuming task because different operating systems have different application programming interfaces (API). For example, Linux uses a different API for application software than Windows does.

Cross-platform

Cross-platform is also known as multiplatform or platform-independent.

Differences between Angular versions :

When it all started, this framework was called AngularJS and alludes to what we now know as Angular 1.x. Then, Angular 2 arrived as a complete rewrite of the framework, improving from lessons learned and promising performance improvements, and a more scalable and more modern framework.

Just for fun :-)

The first version of Angular was named Angular 2. Later on, it was renamed to “Angular”. From now on, every time we use the term Angular we are referring to the latest version of the framework including Angular 2, Angular 4 and Angular 5.

Why was Angular 3 skipped?

you may thing 🤔

Solution:

  • Angular is being developed in a MonoRepo it means a single repo for everything. @angular/core, @angular/compiler, @angular/router etc are in the same repo and may have their own versions.
  • The advantage of MonoRepo is, you don’t have to deal with the versioning of the code dependencies.
  • Now the problem is with the @angular/router which is already in a 3.X version. And that’s because of some active and huge developments on the router section, like route-preload.
  • Now releasing Angular as version 3, with its route on version 4 will create confusion
  • To avoid this confusion they decided to skip the version 3 and release with version 4.0.0 so that every major dependency in the MonoRepo are on the right track.

What’s new in Angular compared to AngularJS

Let’s go through the main differences between AngularJS and Angular:

  • Angular is a complete rewrite of AngularJS
  • An Angular application and its architecture are different from AngularJS. The main building elements for Angular are modules, components, templates, metadata, data binding, directives, services, and dependency injection
  • Angular does not have a “scope” concept or controllers, instead, it uses a component hierarchy as its main architecture
  • Angular follows a modularity concept. Similar functionalities are kept together inside modules. This gives Angular an optimized lighter core
  • The controller concept, which was present in AngularJS, was removed from Angular 2 and above which are component-based UI. These help developers divide applications into components with desired features. These helped improve the flexibility and reusability compared to AngularJS
  • Angular expression syntax is focused on “[ ]” for property binding, and “( )” for event binding
  • With AngularJS, building a search engine (SEO) friendly Single Page Application was a major difficulty. But this bottleneck was eliminated with Angular 2 by enabling application rendering in the server. These tasks are possible thanks to the Angular Universal module.

Angular 2 also recommends using the TypeScript language, which introduces these features:

    Get Saravana Prakash’s stories in your inbox

    Join Medium for free to get updates from this writer.

  • Static Typing
  • Object-Oriented Programming based on classes
  • Support reactive programming using RxJS

On top of TypeScript features, Angular also includes the benefits taken from ES6:

  • For/Of loops
  • Improved dependency injection
  • Iterators
  • Reflection
  • Dynamic loading
  • Asynchronous template compilation
  • Simpler Routing

From Angular 2 to Angular 4

There were some major changes, but mostly on the project structure with lots of refactors, that made the framework more stable.

  • Smaller and faster. The upgrade from 2.0 to 4.0 has reduced the bundled file size by 60% while also improving the applications speed.
  • Angular 4 is compatible with newer versions of TypeScript 2.1 and TypeScript 2.2.
  • Angular Universal: The vast majority of the Angular Universal code has been merged into Angular core.
  • Animation Package: Animations taken from the Angular core and set within their own package. Meaning that if you don’t use animations, the excess code won’t end up in your app.

From Angular 4 to Angular 5

Angular 5 is full of new features, bug fixes, performance improvements, and some code deprecation as a clean up of the refactor from version 4.

  • Optimizations to the build process that reduces the application size by removing unnecessary code.
  • Material Design components with server-side rendering.
  • Angular Universal improvements for code allocation between the server and client-side versions of the application.
  • An improved compiler that supports incremental compilation meaning faster rebuilds.
  • RxJS (reactive programming library) has been updated to version 5.5.2 or later.
  • BREAKING CHANGES: Angular now requires TypeScript 2.4.x.

New Features And Improvements In Angular 6

  • Angular Elements
  • Ivy Renderer
  • Component Dev Kit (CDK)
  • Service Worker
  • Schematics

As of now, Angular 6 is the latest release. We will briefly discuss the new features of Angular in the next blog.

My Sample Angular 6 project:

“You can learn new things at any time in your life if you’re willing to be a beginner. If you actually learn to like being a beginner, the whole world opens up to you ” — Barbara Sher

Click here to see my sample Angular 6 Web App in action

To be continued…

✉️ Subscribe to CodeBurst’s once-weekly Email Blast, 🐦 Follow CodeBurst on Twitter, view 🗺️ The 2018 Web Developer Roadmap, and 🕸️ Learn Full Stack Web Development.

--

--

Saravana Prakash
Saravana Prakash

Written by Saravana Prakash

Just a learner who loves to write code ✍️

codeburst
codeburst

Published in codeburst

Bursts of code to power through your day. Web Development articles, tutorials, and news.