Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 10:18
    Saad-Amjad commented #23609
  • 10:12
    pkozlowski-opensource synchronize #32131
  • 10:06
    googlebot labeled #32235
  • 10:06
    ngbot[bot] milestoned #32235
  • 10:06
    devversion review_requested #32235
  • 10:06
    devversion labeled #32235
  • 10:06
    devversion labeled #32235
  • 10:06
    devversion labeled #32235
  • 10:06
    devversion assigned #32235
  • 10:06
    devversion labeled #32235
  • 10:06
    devversion opened #32235
  • 10:00
    faran52000 commented #31673
  • 09:58
    faran52000 commented #31673
  • 09:55
    renilbabu03 commented #13590
  • 09:44
    saikumar-everest commented #17013
  • 09:34
    saikumar-everest commented #17013
  • 09:34
    saikumar-everest commented #17013
  • 09:34
    saikumar-everest commented #17013
  • 09:33
    saikumar-everest commented #17013
Edoardo Luppi
@lppedd
Out of curiosity, how do you guys handle multiple branches with different packages versions?
Every time I switch I have to re-install
Worktrees works fine (probably, need to try), but requires multiple IDE instances.
Fabian Wiles
@Toxicable
my team uses bazel, so when you swap branch bazel sees the change and isntalls it before trying to build anything
Edoardo Luppi
@lppedd
@Toxicable oh thanks! Does this require installing packages specifically for Angular?
E.g. @angular/bazel
Fabian Wiles
@Toxicable
nah
Edoardo Luppi
@lppedd
Ok!
Will have a look at the official docs.
Fabian Wiles
@Toxicable
bazel is lang agnostic
rules_nodejs is framework agnostic
@angular/bazel is angualr specific
It's still not stable yet, but getting close
Edoardo Luppi
@lppedd
@Toxicable let's say I go down the @angular/bazel route, does this still have the desired outcome?
Fabian Wiles
@Toxicable
oh they all layer ontop of each other, but I mean that you can use rules_nodejs to run nodejs server apps
so you can use bazel to build your apis and frontends
Edoardo Luppi
@lppedd

@Toxicable I was reading, and a quote

Bazel allows you to declare tasks with clear inputs and outputs. Then when you run a command, Bazel builds a task graph, and only runs the necessary ones, depending on which inputs and outputs changed since the last run

Is this comparable to, say, Gulp?

Fabian Wiles
@Toxicable
yupyup, it's definately similar to Gulp, except so much better
Edoardo Luppi
@lppedd
@Toxicable awesome. I'll give it a try then
Fabian Wiles
@Toxicable
It's a generic task runner, you can configure it to run any sort of build and test process
but it's definitely more complex
Edoardo Luppi
@lppedd
Damn... I have a custom CLI Builder...
Seems with the angular package it will use Bazel specific ones
Fabian Wiles
@Toxicable
yup
Fabian Wiles
@Toxicable
under the hood it just uses rollup and other normal tools
nothing special
Edoardo Luppi
@lppedd
I see they mention SASS/SCSS files. I suppose they've integrated a step for compiling them.
But what about Less? Will I have to add a task manually?
Fabian Wiles
@Toxicable
yup we support less
just put in that rule the the day
Edoardo Luppi
@lppedd
@Toxicable Seems pretty new too
Fabian Wiles
@Toxicable
indeed
It's still not stable yet, but getting close
Edoardo Luppi
@lppedd
I think I'll go down the ng add @angular/bazel route, and then customize if required.
I need to figure out how work with both custom-webpack (https://www.npmjs.com/package/@angular-builders/custom-webpack) and Bazel
As I have a dependency library which I don't want to optimize with the build optimizer
Frederik Prijck
@frederikprijck
When using TestBed, Is there any prefered way to mock a parent component that's being injected in the component I'm testing?
Edoardo Luppi
@lppedd
@frederikprijck what do you mean with "injected"?
Frederik Prijck
@frederikprijck

I've used providers: [{ provide: FOO_TOKEN, useExisting: forwardRef(() => FooComponent) }], together with constructor(@Optional() @Inject(FOO_TOKEN) private _parent: FooComponent) {} which seems to work fine when running the application. However, in order to allow TestBed to instantiate the Component that's injecting this, I need to add this to the providers:

{
  provide: FooComponent,
  useValue: {}
},
{
  provide: FOO_TOKEN,
  useValue: {}
}

If I don't provide both, I get No Provider for either FooComponent and FOO_TOKEN.

Toto
@ThomasVallet
Hey guys, I've got a refreshService that refresh my page every 5 seconds. But when I change too fast from one page to another, or I got one page that is really long to load, my refreshService still refresh the first page that I'm not on anymore. Someone already got a problem like that ?
Jorrit
@jorrit-wehelp
@ThomasVallet first of all why?? But you could inject the router and listen to navigation events to temporarily disable/delay your refresh timer
as for 'page really long load', that would require some cooperation from that page component, so it can signal when it's ready
Toto
@ThomasVallet
@jorrit-wehelp , well, later I'll get something like Stomp to get my data from the backend, so when my back will have new data, my front will get it too. For now I didn't implement that on my application, so I have a refresh every 5sec because my data can change a lot.
It's a different refresh for every page that needs it, and normally on ngOndestroy it unsubscribe, but I think, sometimes it doesn't has time to unsubscribe, so it still refresh the old page data
Well, it still calls the API, but I see the new page ofc
Jorrit
@jorrit-wehelp
@ThomasVallet normally one would just use observables for the data (that could refresh every 5s)
Toto
@ThomasVallet
Oh, maybe if I can refresh observable... How can I achieve that ?
Jorrit
@jorrit-wehelp
you'd have the functionality in a data/api sevice, that way you can later on easily replace the implementation to stomp later on, without changing any frontend code
JuanCarlosJr97
@juancarlosjr97

Hi guys, one question

I have a FormControl that is enable and disabled depending on other options, but if is enable and then disabled, the FormBuilder condition will be false because it was activated, how can I changed this???

Toto
@ThomasVallet
start(value: any) {
    // console.log(value);
    this.value = value;
    this.stop();
    this.refreshInterval =
      this.action(value)
        .pipe(
          delay(this.configService.refreshPeriod)
        )
        .subscribe(() =>
          this.start(value)
        );
  }
got this that refresh every 5sec, in a separate service that my services that need to refresh call
Jorrit
@jorrit-wehelp
many ways to do that with rxjs, depends on the source. One pattern would be interval(5000).pipe(switchMap(() => getTheData()))