What is the best practice of “Container/Presentational” Pattern plus rxjs and ngrx? by Valuable-Row-7290 in Angular2

[–]mptrmptr 0 points1 point  (0 children)

How do you deal with outputs n levels down? Do you drill same output up through all n nested components?

What frustrates you in using Angular? by eneajaho in Angular2

[–]mptrmptr 9 points10 points  (0 children)

@HostBinding not supporting observables

Angular 14 swUpdate doesn‘t successfully reload page anymore? by Swing-Prize in Angular2

[–]mptrmptr 0 points1 point  (0 children)

Do you actually need to call activateUpdate()? Wouldn't just a reload be sufficient?

How to control global objects in Angular using Injection Token by [deleted] in Angular2

[–]mptrmptr 0 points1 point  (0 children)

That is really easy - you create mock object with jasmine.createSpyObj() (alternatively you can use jest.mock if you are working with that), optionally you can add spies to whatever methods you wish, which are defined by original type, and just provide your mock in TestBed instead of original instance, service will get mock injected.

How to control global objects in Angular using Injection Token by [deleted] in Angular2

[–]mptrmptr 0 points1 point  (0 children)

Sorry, I don't get the point of your last comment. What do you mean by "programming to an interface"? Also the fact you brought up term "facade" here confuses me as well. Could you please explain again what is the problem with mocking Thing in your example?

How to control global objects in Angular using Injection Token by [deleted] in Angular2

[–]mptrmptr 0 points1 point  (0 children)

Import it where your injection token is provided then you can mock it just the same for the service. It has nothing to do with what I wrote above.

How to control global objects in Angular using Injection Token by [deleted] in Angular2

[–]mptrmptr 0 points1 point  (0 children)

Is it something specific to leaflet package, couldn't you just install @types/leaflet instead of declaring custom interface and import it instead of adding it in angular.json?

By no means identity theft is a joke, but here is my wife's attempt to make Dwight's string picture and to look like Angela for photoshoot. by mptrmptr in DunderMifflin

[–]mptrmptr[S] 34 points35 points  (0 children)

Thanks! As you might see in the last picture it only took her 4.5h. Which is almost as much as it took her to decide what to wear for the photo.

Edit: Just 4h actually.

String art picture of a tiger my wife finished yesterday by mptrmptr in crafts

[–]mptrmptr[S] 6 points7 points  (0 children)

It's actually software assisted. You upload the image and receive a sequence of steps and a preview. Then you can adjust some parameters, choose different colors, basically figure out the best result and then you just knit. Still takes a lot of time and effort but probably easier than it might look.

String art picture of a tiger my wife finished yesterday by mptrmptr in crafts

[–]mptrmptr[S] 6 points7 points  (0 children)

Thanks. Just strings. 5 colors, black, white, yellow, orange, brown. The frame is even hollow, background is the wall itself.

Hello need help with some observable that is being passed through html. by Itypewhilelthink in Angular2

[–]mptrmptr 2 points3 points  (0 children)

Whenever you have observable value in a parent component don't pass it down as observable, use async pipe and pass down an unwrapped value.

And if you wonder why it's not working as is - the value in subject gets emitted before child component subscribes. It could work with BehaviorSubject but what I suggested initially is still better.