Hacker News new | past | comments | ask | show | jobs | submit login

We've been working on the next version of Ionic with Angular 2, and I've been really impressed by it. No more two-way data binding and going crazy with ngModel, scope oddities are gone, etc. Scope is replaced by component instance data, and controllers by component constructors and methods, just like it should be! Building components is a lot easier than directives, and they can be extended and composed in a more OO fashion. It's way more accessible and easier to learn than v1 was.

Also, it's actually a lot closer to being ready than people think. We've had relatively few roadblocks despite the alpha status. It tries to do less than v1 did, which we appreciate as a framework extension.

So, obviously we are heavily invested in Angular, but we also see the v1 design issues firsthand and are the first to admit Angular can, and should, be better (though people are building amazing applications with it today). I'm convinced v2 is going to be great for the project and switching costs won't be as terrible as previously predicted.

Plus, it's going to make v2 of Ionic a lot faster and better, so I'm all for it.

(also, we are starting a series of posts on how Angular 2 works, if you're interested: http://blog.ionic.io/angular-2-series-introduction/)




Agreed on this on all counts, as a current consumer of Ionic v1 and having used Angular intensely for the past 2 1/2 years. I'm also looking forward to using Ionic 2, I know you guys have been hard at work on it and I believe Drifty will come up with something far more awesome than Ionic 1 with the better API & design available in Angular 2.

I disagree with many of this article's points. I was once a junior developer, and what Angular did was bring a lot of better practices to my code and exposed me to a lot of things that I would not likely to have been exposed to in such an easy manner, such as unit testing, easy to grasp high level structures. From what I have seen, it also has introduced a lot of better practices to a lot of companies, whose developers previously wrote awful code that was hard to reason about - Angular 1 does not cure this completely, but it helps give a foundation that does ease life some when working with flawed architecture, since it discourages even worse stuff strongly by design and by communication.

Angular 2 is already shaping up to be absolutely awesome so far, excepting how it handles dynamic components currently, but I believe this will be fixed before it reaches beta status - it is moving extremely fast currently. It feels very similar to using React, except with more standards-based tooling & browser technology support (Web Components, ES6 usage built into its design, etc.), no JSX, and less clunkiness (the getters/setters for component states in React get clunky quickly, as well as the various other checks).


For me, the two way data binding and ng-model are the best parts of Angular. What do you do instead?


Right now, it's event driven: input triggers an event, event is handled in component, component state is updated. For the one-way case (that I think is pretty awesome): a zone is set up in the component to detect changes locally in the component (even changes in setTimeout) and update the components template only.

I think there's room for a 2-way like wrapper for the common input use-case (ala ngModel). Still digging in though.

(way more info on change detection in v2: http://victorsavkin.com/post/110170125256/change-detection-i...)


> So, obviously we are heavily invested in Angular

You probably don't need angular at that point anyway. You could make up your own stack it wouldn't make a difference. Or it means depending on a framework that may change with each version new, breaking all the code of your users because i'm pretty sure you won't be maintaining old versions of ionic for long.

Don't break interfaces, that's what made Linux popular, that's what made js popular,jquery popular, even windows(until the modern ui fiasco)... Refactor but don't break. Eventually you people following angular demise will learn it the hard way.


> what made js popular

What made JS popular is that it is the only language available to do client-side development in the browser.


Though your comment is overly dramatic, I agree to an extent. Ionic "transcended" angular to the point that a lot of new Ionic devs learn Angular through Ionic.

That being said, Angular 2 is a big technical improvement and the changes required to support it aren't too burdensome. It will make Ionic apps faster (on mobile we can use any perf improvements we can get). We are going to work hard to not break interfaces as it pertains to the Ionic API.


Mark my words, you don't need Angular but you're now taking a risk with each version of a product you don't even need at first place.The time spent rewriting your entire framework is some time not spend writing new features for the current one.


So I am thinking about learning Angular for the sole purpose of using Ionic with my Cordova apps. Does it make sense to learn Angular 1.X now or is it close enough that I should try and learn Angular 2.0?


I think it makes sense to learn v1 right now, mainly because with 1.3 and 1.4, the delta between Angular 1 and 2 is shrinking.

Some quick tips for making the transition smoother:

  * Use "controller as" syntax: http://toddmotto.com/digging-into-angulars-controller-as-syntax/
  * Use ES6 if you want http://blog.thoughtram.io/angularjs/es6/2015/01/23/exploring-angular-1.3-using-es6.html
  * Build components using element tags not classes. (attributes are fine but components are better expressed as unique elements).
Note: a lot of of the Ionic components (as mark up) won't be changing.

Here's a talk (including Andrew Joslin, an Ionic dev) about moving from 1.3 to 2: https://www.youtube.com/watch?v=pai1ZdFI2dg




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: