Most of the sources say that the biggest difference and the reason we cannot call them the same framework is the structure. AngularJS was based on the Model View Controller (MCV) while Angular 2 is based on the component structure.
What else?
- Angular 2 uses TypeScript (as all the versions after 2). Angular 2 allows using those languages: ES5, ES6, TypeScript, Dart while AngularJS allows only ES5, ES6, Dart
- Angular 2 uses Hierarchical Dependency Injection (AngularJS not)
- The Structural directives’ syntax was altered from
ng-repeat
(AngularJS) to*ng-for
(Angular 2+) - In Angular 2 the local variables are defined by a hash prefix
- Angular 2 – use of Dependency Injection
- In spite, all the new changes Angular 2 is a bit (20 kb) lighter than AngularJS.
- When AngularJS was built no one thought of the mobile devices while Angular 2 is mobile-friendly.
- Angular 2 provided camelCase syntax
- The
$scope
was a main concept of the AngularJS but there’s no$scope
in Angular 2. In Angular 2 you usethis
instead. - Components (Angular 2) instead of controllers (AngularJS)
As you can see above there are multiple changes, so we can agree that if you already have a project based on AngularJS and you want to move to Angular 2 or higher it would be easier to create a new project than change one line after another.