Raghu
Raghu

Reputation: 244

Writing angular 1 app for angular 2 future

I have recently started learning angula2, it's impressive so far. I have no experience with angular1.

My preference is to use angular2 for a new web i am developing, but the only problem is lack of feature rich stable ui components at this moment,Which is a company policy.

Is their any guides to write angular1 in typesctipt and using component focused design, Such a way as its easy to upgrade to angular2 few months later?

Upvotes: 1

Views: 57

Answers (2)

Atul Sharma
Atul Sharma

Reputation: 10710

Angular 1.5 introduced web components .. that was found in Angular 2. So, migrating an Angular 1.5 app to angular 2 is quite a bit simpler than migrating and Angular 1.0 - 1.4 app.

Follow a few practices like, 
- Avoid writing directives
- Use inline css 

to save time while migrating..

Just research a bit you will get more ..

Upvotes: 1

hakany
hakany

Reputation: 7254

In the following guide the steps to upgrade to angular2 is described. https://angular.io/docs/ts/latest/guide/upgrade.html

Based on your application it could not be easy to upgrade because in angular2 there are a lot changed if you compare with Angular 1.x (https://angular.io/docs/ts/latest/cookbook/a1-a2-quick-reference.html). Therefore keep in mind that upgrading could not be easy.

If you choose angular 1.x because of ui components, is using an alternative ui components for angular2 not an option? for example if you want to use material for angular2 (https://github.com/angular/material2) which is still in beta you could use the components which are already finished and later update your view with the other components when they are get available.

Another option would be to use alternative library for example you could use bootstrap (https://github.com/valor-software/ng2-bootstrap) until material2 is out of beta.

Upvotes: 1

Related Questions