01Mentoring is handing over decisions
Mentoring junior developers on component architecture, PrimeNG, Tailwind CSS and SCSS taught me that skill isn't the bottleneck. Most juniors can write a component. What they can't yet do is decide where it should live, what its inputs should be, or what happens when the API fails.
So I structure mentoring around decisions: each stage hands over a new kind of decision, with support, until the developer is making all of them for a whole feature.
02The stages
-
01
Stage 1: well-scoped tasks
A presentational component with a clear design and agreed inputs. The decision handed over: how to build it cleanly.
-
02
Stage 2: own the component API
They propose the inputs, outputs and states before writing code. We discuss it for ten minutes; it saves an hour of rework.
-
03
Stage 3: own the data flow
Where does state live? What's derived? What happens while loading and on error? Now they're designing, not just implementing.
-
04
Stage 4: own a small feature
Route, store, components and tests. I review the plan up front and the code at the end, and stay available in between.
-
05
Pair on the hard parts, not the easy ones
Pairing time goes to the tricky bits (RxJS pipelines, focus management, tests for async code), where explaining live is fastest.
-
06
Review to teach, not to gatekeep
Every non-trivial comment says why and links an example. Repeated comments become shared docs everyone can learn from.
03Teaching testing early
The habit with the biggest long-term payoff is writing tests for the component's behaviour, not its implementation. A junior who learns early to test "clicking Save emits the form value" instead of "method X was called" writes code that's easier to refactor, and starts thinking about components from the outside in.
I use the same starter exercise with everyone: build a small button or field component with signal inputs and an output, then write tests that set inputs and assert on what the user sees.
04The starter testing exercise
The test sets signal inputs through componentRef.setInput, reads the rendered DOM, and checks the emitted output — behaviour only, no private methods.
describe('SaveButtonComponent', () => {
let fixture: ComponentFixture<SaveButtonComponent>;
let button: HTMLButtonElement;
beforeEach(() => {
fixture = TestBed.createComponent(SaveButtonComponent);
fixture.componentRef.setInput('label', 'Save client');
fixture.detectChanges();
button = fixture.nativeElement.querySelector('button');
});
it('shows the label', () => {
expect(button.textContent?.trim()).toBe('Save client');
});
it('is disabled and busy while saving', () => {
fixture.componentRef.setInput('saving', true);
fixture.detectChanges();
expect(button.disabled).toBe(true);
expect(button.getAttribute('aria-busy')).toBe('true');
});
it('emits save on click', () => {
const emitted: void[] = [];
fixture.componentInstance.save.subscribe(() => emitted.push());
button.click();
expect(emitted.length).toBe(1);
});
});
The takeaway
Grow juniors by handing over decisions in stages (implementation, then API, then data flow, then whole features), and use pairing, teaching reviews and behaviour-focused tests as the tools. The goal is a developer who no longer needs you for the next feature.