Hacker News new | ask | show | jobs
by xeromal 3567 days ago
We've been using Angular 2 for about 6 months now. Having things deprecate several times like the routing engine was annoying but that's the cost of being on the cutting edge. The side benefit is that we learned a lot about the inner workings of Angular.

I agree with your annoyance with the UI libaries. It's been a PITA just to find a working datepicker. We eventually rolled our own starting with the source of an abandoned date picker project. Haha.

3 comments

There is a working datepicker here: https://ng-bootstrap.github.io/#/components/datepicker

Source code here: https://github.com/ng-bootstrap/ng-bootstrap/tree/master/src...

Be aware, it is not perfect atm, especially around validation, but it is pretty much the only datepicker out there for ng2 in the open source world (not even Angular Material 2 has one).

It just got even better with alpha.5 (released just seconds ago :-)) - now you can have datepickers in popups: https://ng-bootstrap.github.io/#/components/datepicker
Angular Material 1 only got its date picker in Oct last year (0.11.2). Oh how we celebrated!
Have been making use of this component. This issue[0] regarding supporting floating labels is quite sad really.

[0] https://github.com/angular/material/issues/4233

This looks pretty nice. I definitely have not seen this one before. Thanks!
Just curious if you could speak to any of the performance / development time metrics? I.e. do you spend less time developing a component in ng2 vs. ng 1.x ? Do you get better performance with ng2 vs. 1.x etc?

I know it's supposed to be faster - I just am not finding people using this stuff in production seriously until now.

I don't want to clog up the angular group with these informal lines of questioning - obviously.

It's super easy to write a component in ng2. I feel like it's faster, but it's been about a year since I really used ng1.

My favorite thing about ng2 components over ng1 would be the annotations. One annotation turns my component into a component. It links the html template, sets up the services, injects the other components and directives it needs in one simple annotation. In ng1, I remember it being cumbersome to set everything up.

To use a component in your existing app. You create a new ts file. Add an annotation. Write the template inline or in another file. Reference that ts class in your other components. That's it!

I faced the same problem and found this one: http://www.primefaces.org/primeng/#/calendar

It basically uses the JQuery date picker and works quite well.

I tried that one out, but I feel like it choked on a regular javascript date when binding. I ended up skipping it.