Live data from Hacker News

Angular 2 Final Released

angular.io

371–380 of 452 posts

Re: Angular 2 Final Released

#371

Earlier quoted context omitted.

I'm just writing a first React app, and read beforehand that it was going to be difficult to choose which libraries to use, and to get them to work together, but I haven't found that to be much of an issue in practice. create-react-app set up all the build tooling, for a router the clear recommendation is react router, and for a flux implementation the clear recommendation is Redux. It feels like there's a well defin…

Good thing you don't have clients demanding IE compatibility. Bye bye ES6 :-(

Doesn't babel (ES6 --> ES5) solve this issue or is there more to it?

Re: Angular 2 Final Released

#372

Serious question : Why are SPA frameworks so popular these days? When someone asks "What should I use for web development?", It's now all about React/Angular/Ember/etc. But when I look at how are built the sites I like and visit frequently, I'd say 95% of them are not SPA, they are classic sites where the server generate each page (sometimes with one or two Ajax requests)! The Single Page pattern is great for desktop…

IMO building classic websites is a solved problem, while building web apps isn't.

Classic websites have CMS, things like Wordpress, and a ton of MVC frameworks that have been tweaked over the last decade, like Rails, Django, ASP.NET MVC, etc. When it wasn't a solved problem, a new one like this was popping up in the news every other week.

Now, that that's done, people are trying to do other things, like complex web apps...and so that's where the brain time is being spent.

Re: Angular 2 Final Released

#373

Earlier quoted context omitted.

Not sure if this helps, but trying to learn Angular2 I wrote a weather app with it using RC5. It is not the cleanest and I never used Angular 1 so I can't do a comparison. https://github.com/mattsmithdev/weathercard.angular2

you can refactor those nested observables using mergeMap: this._settingsService.settings$.mergeMap(settings => { this.settings = settings; return this._weatherService.getLatestWeather(this._location, settings); }) .subscribe( weather => this.weather = weather, error => this.errorMessage = error );

Thanks. Learning observables was definitely a little challenging, so I appreciate the insight.

Re: Angular 2 Final Released

#374

As someone who uses Angular 1 currently but would pick React for their next project, I'd love to see a list of reasons why I should use Angular 2 over React. If nothing else, Angular just stranded all their developers, while React has a huge head start on mindshare/plugins/tutorials/etc.

For economical reasons. We decided between ng2, React and Vue.JS: https://docs.google.com/spreadsheets/d/1ULB2GjA3ytXAN_Sn-fEy... React would mean to rewrite your whole application as it has a totally different basic concept. Following the ng2 migration path you're able to migrate slowly.

at my last job we did a gradual migration from Angular 1 to React. Its similar to the path to Angular 2 really. React and Angular can live side by side... All we did was build an Angular directive that can render a react component in a subtree (that's easy), and a React component that could render an Angular directive (that's a little harder, but not that bad).

With that, we could put a React component anywhere in our Angular app, and reuse Angular directives inside of React until we got around to rewriting them.

That ended up quite smooth.

Re: Angular 2 Final Released

#375
post #307
post #196

Earlier quoted context omitted.

>The HTML template in Angular 2 is stored in a string. This has several disadvantages This is patently false. Just use "templateUrl" instead of "template". This allows you to specify a file instead. This is the way I always did it in angular 1 as well. I don't really understand why style guides & general practice recommend embedding html in the javascript though. It's horrible.

Does Angular 2 do any compiler magic with these templates? or are the templates parsed at runtime?

we can do both. In JIT mode, we XHR for them and compile them on the fly. In AOT mode, we do that at build time and turn the templates into TS code, which we can then typecheck (thus giving you typechecking against templates) - the benefit of this is you don't have to ship the compiler code to the browser, don't pay the cost of runtime compilation, and the generated code is monomorphic and thus highly optimizable in browser VMs.

Re: Angular 2 Final Released

#376
I heard that a particular company, Rangle, worked on AngularJS2 and from what I've heard of them they're an MVP/dev-agency so it isn't surprising to see some of the complaints here about broken backwards compatibility and bad documentation around testing.

Seems few people know how to steward a free/open source software project that has lasted over 5 yrs.

Re: Angular 2 Final Released

#377

Serious question : Why are SPA frameworks so popular these days? When someone asks "What should I use for web development?", It's now all about React/Angular/Ember/etc. But when I look at how are built the sites I like and visit frequently, I'd say 95% of them are not SPA, they are classic sites where the server generate each page (sometimes with one or two Ajax requests)! The Single Page pattern is great for desktop…

> I think I still prefere the "feel" of classic websites. Your hacker biases are showing. The sites where 95% of people spend most of their time (Twitter, Facebook, Instagram, etc.) are all built as single page "applications." Users expect rich interactivity from websites these days and are usually not tolerant of UI refreshes. The comparison is not to "desktop" applications but to mobile apps. Users expect a mobile…

And the performance of all those is just garbage in Firefox on a 3 yr old laptop and isn't that much better on mobile.

They're fantastic for forcing people to buy new hardware just to look at information :|

Re: Angular 2 Final Released

#378
post #369
post #363

Earlier quoted context omitted.

> That is exactly what I meant, sorry for not being clear. All good, I'm probably tired (Australian time). Maybe it's my inherit bias as an Ember user, but I'd argue Ember's templating language is alot simpler than you're suggesting > But by logic I meant all sorts of control structures, which though looks light-weight at first, needs a large number of language elements to function. To name a few: variables, expressi…

I haven't worked with Ember's templating syntax, so don't have any thoughts to offer there. I was however bitten by Angular v1's templating, on which my comments were based. SASS and LESS both add language semantics over CSS and suffer from the same problem. So does for example Jekyll's templating language. But in case of CSS, the language additions are a practical necessity - it lacks even basic abstractions, which…

Sure, I'll give it a read.

Re: Angular 2 Final Released

#379
post #242
post #179

Earlier quoted context omitted.

Maybe because Angular material components are much better than material-ui?

I've been very happy with the material-ui components for React. They cover every component I need, and it was trivial to integrate them into an existing app over time, no need to do a full conversion on day one. They also seem entirely React idiomatic, I've learned a lot about how to build reusable components myself from their API.

I was put off by their TextField implementation. Their oversized element doesn't play well with browsers, eg. the browser's auto-complete looks completely out of space.

Re: Angular 2 Final Released

#380
post #85

Earlier quoted context omitted.

It's not about just simple - it's about making the right architectural choices that don't come back to bite you due to the need to make a change that brings down a house of cards from a library perspective. ng-bootstrap avoids problematic apis such as component-based modals, and makes use of the much more natural service-based approach to allow developers maximum flexibility. If a developer prefers a component-based…

I don't think that your service based model is more extensible. Yes, I could build a component based version on top of the service based version. But I can also build a service based version on top of the component based version. In fact from a peek at the source, the NgbModal class is built on a NgbModalWindow class which acts much like react-bootstrap's modal. So, ng-bootstrap builds the service based version on a…

A service based one on top of a component based one has inherent data flow problems. ng-bootstrap, following in the footsteps of UI Bootstrap, takes a promise-based approach because we believe this is clearly the best API pattern out there for dealing with modals from experience working with users' needs. An evented model is extremely cumbersome/awkward, and any component-based model must go that route to signal when it opens/closes. A promise best describes this situation.
Post reply on HN