Wire Angular routes, guards, services and templates for the kecamatan office's service counters. 16 levels, played right in the browser with nothing to install.
What the levels ask
Next week the Kantor Kecamatan Sukamaju's service app goes live. Its screen hangs over the counters, and every counter is an Angular route: the address on the screen decides which component shows in <router-outlet>. Ms. Tiwi has already put up a KTP button that goes to /ktp. Fill the KTP counter route's path so Mr. Tono, who taps that button, reaches Counter 1.
The KTP counter now reads the NIK from the address: /ktp/:nik. Mr. Tono comes first, then the clerk taps Berikutnya and the address changes to Mrs. Sari's NIK. The route is the same, so Angular reuses the LoketKtp component it already has instead of making a new one. Fill how nik is read so the screen changes to Mrs. Sari too.
Two counters stand side by side on the screen: KTP and Pindah. Both ask for Antrean with inject. Ms. Tiwi says each counter has its own queue, starting at 1. Mr. Tono and Mr. Bayu take KTP numbers, Mrs. Lastri a Pindah number. Fill the providers of the LoketKartu component so the numbers come out right.
A moving letter's number uses the district's area code. That code is not a class, so Ms. Tiwi keeps it in an InjectionToken with a factory that gives its value. Mrs. Lastri goes to the Surat Pindah counter. Fill how the counter gets that code so the letter's number is No. 32.04.11/PINDAH/017.
Mrs. Yanti wants her KK found. The clerk taps Cari berkas, and the counter asks Arsip, which keeps the files in Lemari. Fill the line inside cariBerkas() so Mrs. Yanti's file shows on the screen.
The Bansos counter serves only villagers registered in the DTKS. The cekDtks guard checks the NIK before the counter opens. Mrs. Sari is registered, Mr. Karim is not yet. Fill what the guard returns for an unregistered villager, so Mr. Karim is shown to the Meja Informasi and the screen is not left on someone else's page.
The Surat Pindah counter may open only once the villager's file is on the desk. Arsip takes 300 milliseconds to search. Mr. Harun comes with his NIK in the address. Fill the berkasResolver resolver so that when LoketPindah is made, Mr. Harun's file is already there.
The Aduan counter is rarely used, so Ms. Tiwi put it in a file of its own, pengaduan.ts. That file must not be loaded when the screen comes on or when Mr. Tono goes to the KTP counter, and it must come when Mrs. Ijah taps Pengaduan. Fill the import line at the top and how the pengaduan route loads its component.
The bansos recipients' board is at the bottom of the screen, far below the waiting room. Building it is heavy, so Ms. Tiwi wrapped it in @defer. The board is built only when it is seen: not when the screen comes on, not while Mrs. Endang waits, but when she looks at the back wall. Fill its trigger.
The queue on the screen has an errand box for each villager. Mrs. Sari types perpanjang KTP in her box. Then Mr. Tono is done and leaves. The list comes fresh from the server every time, new objects for the same villagers. Fill track so Mrs. Sari's note stays in her row.
Ms. Tiwi made one card component for every counter: <kartu-loket>. Its content is sent from outside: the title in the card's head, the rules in its body. The title is marked with a judul attribute. Fill the select of the card head's <ng-content> so the neighbourhood head reads the title on top and the rules below.
The waiting room counts the villagers waiting with the menunggu pipe. When villagers come, datang() adds them to the same list with push. Mrs. Sari then Mr. Bayu come. Fill the pipe's metadata line so the count goes up too.