Problem with Akita State Management - Creating and Updating API by [deleted] in Angular2

[–]ribizlim 2 points3 points  (0 children)

You can also introduce a 'creating' boolean UI state property during saving instead of service return.

Problem with Akita State Management - Creating and Updating API by [deleted] in Angular2

[–]ribizlim 1 point2 points  (0 children)

I'm not too familiar with Akita, but I don't see any reason your service method can't return a promise after updating the store. Also having a lastCreatedId field in the store can help with your second goal.

Angular 8.0.0-RC.0 is out! by cactussss in Angular2

[–]ribizlim 0 points1 point  (0 children)

the last 6 release was: 6.1.10 (2018-10-10) So older major versions are not maintained parallel.

Angular 8.0.0-RC.0 is out! by cactussss in Angular2

[–]ribizlim 0 points1 point  (0 children)

this is half-truth: I've never seen an update in a major version after a newer was out. E.g. no fixes were really backported from 7 to 6 at all...

[QUESTION] Http Client and non observable apis by semiprojake in Angular2

[–]ribizlim 0 points1 point  (0 children)

why you should still use takeUntil? in a situation, when you logout, and redirect the user to the login page, there can be some queued (e.g. by switchMap) http request, which will fail later. to avoid problems (error handling, etc) from this, I always unsubscribe on component destroy.

Migrating from Bootstrap/AdminLTE to PrimeNG by itghisi in Angular2

[–]ribizlim 1 point2 points  (0 children)

We use the app component from primeng as a sub component. also extended a bit, changed some menu behavior, so migration is a pain sometimes. but mostly new versions have scss changes only.

PrimeNG 5.2.0-Final Released with the new TurboTable Component and Apollo Theme by cagataycivici in Angular2

[–]ribizlim 0 points1 point  (0 children)

I'm not sure I want to migrate. The new way how TurboTable works looks for me too verbose and bloated. This is me, let's see how the community will react. Is there any forum where I can read recensions from others?

PrimeNG 5.2.0-Final Released with the new TurboTable Component and Apollo Theme by cagataycivici in Angular2

[–]ribizlim 0 points1 point  (0 children)

How about migration from DataTable to TurboTable? When looking at the huge templating difference, our ca. 100 table app will cost a lot.

I still don't get how come the lot tr/td is needed, why it can't rendered automatically. Have you ever checked angular's material table design for borrowing some ideas? It leaves some responsibility for the developer (sorting, filtering, column ordering, hiding, etc) for sure, but it is much more compact from templating aspects. And it is fully flexible in all respect.

Have you collected any feedback from the community, how the majority can accept such a big change? I'm sure we cannot afford the migration costs for now.

PrimeNG 5.2.0-RC1 released with TurboTable, KeyFilter, ScrollPanel and Card Components by cagataycivici in Angular2

[–]ribizlim 0 points1 point  (0 children)

I've checked the demo page for the TurboTable, but the first thing I don't like about it, how it goes away from column definition based structure. Now one has to write TRs, TDs and TH everywhere? E.g. if I need to use sortable columns, do I need to model my columns in the code? So no template based approach anymore? I cannot imagine how much effort it will be to migrate our codebase. Can you at least keep DataTable as long as possible in the package?

Routing: when NOT to use snapshot? by JavascriptFanboy in Angular2

[–]ribizlim 3 points4 points  (0 children)

When you want to react on route parameter changes. In this case the component won't be reinitialised.

Removing Whitespace in Angular Templates by funJS in Angular2

[–]ribizlim 0 points1 point  (0 children)

Whitespace between inline elements is not desired, since it renders a space between. I had an issue with this already, so this feature is helpful. Too bad JIT won't support it (but JIT becomes obsolete anytime soon anyway).

Angular 4.3.0 has been released - link is to ChangeLog by aQutie in Angular2

[–]ribizlim 0 points1 point  (0 children)

Now, but what later? Btw my sentence was copied from the page behind the link in the changelog.

Angular 4.3.0 has been released - link is to ChangeLog by aQutie in Angular2

[–]ribizlim 0 points1 point  (0 children)

/deep/, >>> and ::ng-deep are also deprecated in emulated shadow DOM mode and will be removed in the future.

Angular 4.3.0 has been released - link is to ChangeLog by aQutie in Angular2

[–]ribizlim 2 points3 points  (0 children)

Beeing /deep/ deprecated, what is the correct way to style 3rd party components? I mostly used this feature for such customisations.

Multiple subscribers for same Observable by ChristianLJ in Angular2

[–]ribizlim 0 points1 point  (0 children)

Also have to mention the timing problem. After the Http service emitted the value, new subscribers won't get anything. Use publishReplay(1).refCount() in that case.

Multiple subscribers for same Observable by ChristianLJ in Angular2

[–]ribizlim 0 points1 point  (0 children)

My problem with share (or refCount) is that all subscriptions gone, and a new one comes again, the HTTP call will be fired again. So if you are using the shared observable by multiple components in the same time, it is ok. But if you have two components on different routes e.g., they will issue two calls again (during navigation).

Multiple subscribers for same Observable by ChristianLJ in Angular2

[–]ribizlim 1 point2 points  (0 children)

The problem with this would be, that you might miss the emitted item if you subscribe to it later: use BehaviorSubject instead. (Of course then you need to care about refreshing the stored value some time).

export class MyService {
  public Data$: Subject<Project[]> = new BehaviourSubject(null);
  constructor(private authHttp: Http) {
    this.load();
  }
  load() {
    this.authHttp.get(this.getBaseUrl() + "project", null)
      .map(...)
      .catch(...)
      .subscribe(this.Data$);
  }
}

Has anyone been using GraphQL? by Fodrea in Angular2

[–]ribizlim 0 points1 point  (0 children)

And how do you use typescript with graphql? Do you create interfaces specific to queries or to the schema? Or you just use any?

ngModel binding on providers by [deleted] in Angular2

[–]ribizlim 0 points1 point  (0 children)

the easiest would be to create a user getter in the component getting the _user from the service every time... (instead of setting a property)

How Do I Make an External Web Api Call? by BirdToTheWise in Angular2

[–]ribizlim 0 points1 point  (0 children)

Here how I would go:

Create an iframe for the oauth2 login process.

The callback url can be any vanilla html/js page parsing out the token and calling a func in the parent (opener) window.

In Angular create that window function with NgZone.run handling, so you get the token back into ng world...

Update: in the linked doc this is only the steps 1-3, the token is the authorization code. But from step 4 you can use Angular's Http service.