![]() The concepts are practically identical, and the similarities don’t stop with templates and components as users dig into pipes, dependency injection, and services, they’ll find tons of similar similarities (I like the sound of that). Once developers make the mental switch from the syntax of Angular 1 to Angular 2, we think they’ll find that they already know Angular 2. Plus, with no custom module system, Angular 2 code interops with the rest of the ES6 ecosystem, making it dead simple to install and import 3rd party code. I know I had to take a month off from a lot of my other work to just understand what all these random terms like transclusion, directives, linking, scope, and so on actually meant.Ī developer new to Angular and starting with Angular 2 will hopefully have way less domain-specific knowledge to learn since they can skip all the esoteric terms from Angular 1 and jump right into ES6/TypeScript code. Us Angular 1 veterans tend to forget how difficult it was to grok Angular 1. *oversimplification, but it feels free to the end user! Reducing the barrier to entry ![]() ![]() In Angular 2 we no longer need to have a custom $scope system to handle data for components, we get it for free* with ES6 and TypeScript! er is available, much like $er would have been in ng1 This concept is exactly the same in ng2, except we use the natural ES6 concept of class instance data! Angular has gone from a custom context system to a standards-based approach since JavaScript has evolved to make this possible (with a little TypeScript decorator magic to make it cleaner): export class ProfileImageComponent user For example, our profileImage directive might have a reference to the current user as part of its scope, or context, so it could render the user’s profile image. In Angular 1, scope was really just the “context” available to a region of the UI. To output a property from our scope or context, we can do this:Īngular 1: Today is from 'home',Īnd the Angular 1 directive as an Angular 2 component: 'profile-image', If we take a closer look at how Angular apps work in each language, we start to see a ton of similarities. One can build UIs and frontend applications in the Angular style with a choice of at least three major language implementations: ES5, ES6/TypeScript, and Dart, though ES6/TypeScript is becoming the de facto Angular standard (i.e. With Angular 1, Angular 2, and Angular Dart, Angular has gone from a specific ES5 frontend framework, to a conceptual framework or design pattern with multiple implementations. In many ways, Angular 2 isn’t really a new framework at all, just a new implementation of the same one we’ve come to know and love. One of the major realizations we’ve had from working on Ionic 2 is how similar Angular 2 and Angular 1 are at a high level, and how understanding this will help developers move from Angular 1 to Angular 2 far more easily. We started building Ionic 2 back when Angular 2 was pre-alpha, with the dream of offering a faster, more standards-compliant, and future-proof mobile web framework than Angular 1 could provide. Do developers have to learn yet another new framework?įew teams have spent as much time with Angular 2 as the Ionic team has. With Angular 2.0 fast approaching and the world of frontend frameworks in a massive transition, there’s been a lot of concern about the impending costs of moving to the next generation of Angular. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |