u/yfain

36 post karma · 113 comment karma · joined Mar 2006

  1. 1points

    A list of my Angular video tutorials (yakovfain.com) [Video]

    0 comments · source

  2. 5points

    Writing a series of articles "RxJS Essentials" (yakovfain.com)

    2 comments · source

yfain

We tried ngrx in a mid-size project but quickly returned to service/BehaviorSubject to manage state. Too much time is spent writing boilerplate code. In this video, I show a small app written with and without ngrx: https://www.youtube.com/watch?v=xLTIDs0CDCM IMO, for small and mid-size apps ngrx is an overkill.

yfain

Both modules are parts of the same project. Take a look at this project that has a root module and shipping module: https://github.com/Farata/angulartypescript/tree/master/chapter2/hello-modules

yfain

Why not just modularizing your app and keeping all user management functionality in a feature module? You root module will have minimal functionality, and you'll be able to reuse the feature module in other apps.

yfain

Recently I recorded an Angular 4 course for O'Reilly: Ahttps://www.safaribooksonline.com/library/view/building-web-apps/9781491996768/. See if you like it. If you don't have an account with safaribooksonline, set a free trial account.

yfain

Not sure which 30 pages you're referring. With CLI, ng build -prod is all you need. There are a couple of more new options, but this is pretty much it. Do you have a reason for not using CLI?

yfain

As per this presentation https://www.youtube.com/watch?v=T83qYxlVOBw&feature=youtu.be (in the second half) upgrading an ng4 project to ng5 should be done with one command. I haven't tried it myself though.

yfain

Yes. It already uses Angular 4 code samples, but as soon as A5 is out we'll update the code. Code samples are here: https://github.com/Farata/angulartypescript

yfain

By the end of this week, Manning should start publishing the MEAP of the second edition of our "Angular Development with TypeScript" book. More than 200 pages are ready so far.

yfain

RxJS is not the only library of reactive extensions. I'm using RxJava as well, and flatMap is a perfectly valid operator there. It's even more powerful than in RxJS as you can control multi-threading with flatMap.

yfain

To make this code work you still need to use @ViewChild to get a reference to #myInput.

yfain

In this video, I show how to deploy an Angular app under a Spring Boot app https://youtu.be/k8r76d8QzXs?list=PLy7t4z5SYNaRN2IDmjq_SSCrb9Sph4zAC&t=2236

It would be similar with Tomcat.

yfain

Every FormControl has a property valueChanged, which is an Observable.If you have three fields (1,2,3), you have three observables. If you merge them and apply the operator reduce(), you'll get the first subtotal.

yfain

Look at the race operator.

yfain

If you're thinking that contractors are more technically savvy than employees, don't be.

yfain

This is a typical dilemma of anyone who is considering going freelance. If you have enough money to pay your bills for 6 months and you really want to become a contractor, then do it. Three months down the road you'll either get a contract that you like or will need to reconsider and go back to full time employment.

yfain

Contracting is just a different way of paying taxes plus working without company benefits. If you're bad at what you're doing, you'll have a hard time finding any job regardless of the type of employment. Go for it.

yfain

Importing AngularMaterial is deprecated and now you need to create a separate feature module listing all material components that you use in your app. Then import this module in your main app.module. Here's an example of such feature module: https://github.com/Farata/angular2typescript/blob/master/extras/auction-angular-material/client/src/app/auction-material/auction-material.module.ts

yfain

We use Ultimate primeng theme, which has a scss variable for theme customization.

yfain

Angular Material 2 has about 25 high-quality components. PrimeNG has 70+, which are also great. Our strategy is to use Material components that are available, and when we need more, we add the missing ones from PrimeNG. We use both libraries in prod.

yfain

I use observables, but want to be able to use @input() as well, which AFAIK are not used with ngrx.

yfain

IMO, an Angular injectable service can fit the bill for the state management. A component makes a change in the state object located in the service, a new copy of the state object is created, and the service emits an event about the state change. Other components subscribe to this event. If the state object was bound to some components via @Input() properties, they'll get the ngOnChanges() invoked. As of now, I'm not sold on the need of ngrx or redux in Angular apps. It just makes the code more difficult to understand.

yfain

In your package.json in the scripts section declare the command build that runs ng build and another command named prebuild that runs your maven-build-and-copy.cmd. From now on run your bulds using npm run build command. Npm scripts are smart enough to check that if there are two commands with the same name, but one of them has a prefix pre, it'll run the pre- command first.

yfain

Styling your UI with Bootstrap is different from working with your components using jQuery API.

For example, this app just styles the components using Bootstrap (see angular-cli.json): https://github.com/Farata/angular2typescript/tree/master/extras/auction/client

But this app uses jQuery UI to access a dropdown: https://github.com/Farata/angular2typescript/tree/master/chapter2/hello-world-ts-jquery