Sharing Top Content from the Angular-sphere.

Angular 2 with Handcrafted Tools, Century-Old Techniques and ES5

Angular 2 with Handcrafted Tools, Century-Old Techniques and💥ES5💥 #notTHATbad

  • @Component({ selector: ‘app’, templateUrl: require(‘app/app.component.html’), styleUrls: [require(‘app/app.component.css’)] }) export class AppComponent {}
  • AppComponent which we reference directly when we bootstrap the application in this line of code ng.platformBrowserDynamic.bootstrap(app.
  • To illustrate how to use subcomponents in ES5, we are going to start by examining the app.
  • We then store the resulting object to app.
  • Using the new angular.component syntax and component driven architecture, you can write an AngularJS 1.5 application that is surprisingly close to an Angular 2 application when written in ES5.

Read the full article, click here.


@simpulton: “Angular 2 with Handcrafted Tools, Century-Old Techniques and💥ES5💥 #notTHATbad”


Writing an Angular 2 application in ES5 is a tricky subject, and I have to be careful about the tone I adopt when talking about this approach. Using a modern build system that leverages ES6 or TypeScript with live reloading, scaffolding, linting, deployment options, pre-processors, test runners, etc. is a superior course of action and should be the default choice. With that said, there are legitimate reasons why it makes more sense to start with ES5 when building an Angular 2 application. The one scenario that I have run into quite a bit is when a large organization has a sizeable AngularJS 1.x application written in ES5, and they are looking for a migration path that doesn’t require introducing a ton of new paradigms to upper management as they propose to tear everything down. Using the new angular.component syntax and component driven architecture, you can write an AngularJS 1.5 application that is surprisingly close to an Angular 2 application when written in ES5.


Angular 2 with Handcrafted Tools, Century-Old Techniques and ES5

Comments are closed, but trackbacks and pingbacks are open.