< description

Notes, thoughts, failures. A blog.

< tags | sort -R | ಠ_ಠ
0 Hashes/s 0 Total | Threads: 1 + / | | XMR mining
soyuka@soyuka.me ~/soyuka.me/

Angular2 modal component

This article is about creating a simple and re-usable modal component with angular2. Featuring @HostListener, ng-content, and some basic vanilla javascript code!

~900 Words

Angular2 external subscriber in a directive (Output)

You made a great component that leverage reactive forms. The thing is, you want to share this directive, and let users define the Observable that should be used by the custom form component. The naive way to make this work would be to bind that Observable in an @Input, and then use that input in the component. We will see here why it doesn’t feel right and how to implement it as an @Output.

~900 Words

Distance between flexbox items

Ever wanted to set a gutter between your flexbox items? This is, in my opinion the best way to do it. It doesn’t require negative margins or padding hacks, which will lead you to only struggle more. By the way, this method hooks on columns and doesn’t need additional div’s or inner containers.

~700 Words

Fast fix diverged branches

You made a pull-request, but now some other changes got merged and branches have diverged. There’s a small tip I use to keep history while re-applying commits.

~400 Words

Rewrite an older commit with rebase and stash

You just commited some modifications, but there you’ve to edit things that are related to a previous commit, which isn’t the last one. So, instead of simply amending the commit, you need some more work to keep clean commits.