mgechev / angularjs-style-guide

📚 Community-driven set of best practices for AngularJS application development

Home Page:https://mgechev.github.io/angularjs-style-guide/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Migration to Angular 2.0

yanivefraim opened this issue · comments

What about adding style guidelines that are focused on preparing for Angular 2.0.

I saw this amazing video from ngVegas and read this cool article, which let me think that we should really focus on preparing our apps so it will be much simpler to migrate to Angular 2 when the time comes.

What do you think? Is there a place for a section like this in the guide?

I think it makes sense but somehow I don't see it fit in the current document.

Lets collect a few more opinions and add the section if there are more people, who think that we need it! :-)

I'm for the offer. As Angular2 is one of most discussed topics, any guides on "How to write on Angular1 to be prepared for migration to Angular2" will be totally useful.

A lot of the magic with migration is sticking to best practices in angularjs 1.x. Use modular code, separation of concerns etc. With angular 1.x, if you make use of services as intended, have thin controllers and componentized directives you're already halfway there.

So, I would keep the angularjs 1.x doc separate, as-is (as it probably already has the best practices stuff in) and create a separate one focusing just on the 2.0 angular stuff.

Check out this site, especially the section

Getting your Angular 1.3/1.4 App Ready for Angular 2

  • Write code as ES6 classes, everything (directives, services, etc.)
  • Use the new Angular router (luckily it’s just around the corner)
  • Use directives more than controllers
  • Use the controllerAs syntax in your directives instead of using $scope

I'm thinking about slight refactoring of the repo.

  1. Move all translations to i18n directory
  2. Add separate markdown file with development practices for easier migration process

On AngularU John Papa announced that he's working with the core team on a migration guide. We can close this issue.