Angular Market Stalls — Angular

The market window's tablet runs hot: find the Angular work that repeats, from computed to track. 12 levels, played right in the browser with nothing to install.

What the levels ask

  1. By late morning the window's tablet runs warm. sumUnpaid adds up the unpaid rent, and a console.count counts it. The board's clock ticks every ten minutes, and two traders pay. Fill in unpaid so sumUnpaid runs once when the board comes on and once per payment, with a number that is always right.
  2. The market head wants each stall's rent written Rp15.000, not 15000. rupiah() in rupiah.ts counts itself with console.count, and RupiahPipe uses it. No stall's rent changes all day. Fill in how .rent writes its number so each stall is formatted only once.
  3. The unpaidOnly pipe filters the unpaid stalls for the list under the tiles, and yesterday it ran at every tick. Fill in the pipe's nature in unpaid-only.ts and pay() in market.ts so the list is filtered only when someone pays, and a stall that paid leaves the list.
  4. Now the board fetches the stall list from the market office's server at every tick, new objects every time, and a stall that has paid moves down. At 07.00 Ms. Fani ticks Mrs. Rina's stall-tile. Fill in track so no tile is rebuilt and the tick stays on Mrs. Rina's stall.
  5. A trader taps their stall to open the cash countdown panel, which subscribes to clock.tick$ in ngOnInit. Four traders open it and close it again, yet the tablet stays busy until noon. Fill in ngOnDestroy so a closed panel leaves nothing running.
  6. Ms. Fani wants the panel's clean-up in one line inside pipe, with no ngOnDestroy. The panel still subscribes in ngOnInit and already asks for DestroyRef through inject. Fill in the operator inside pipe so the countdown runs while the panel is open and stops when it closes.
  7. The cash panel no longer subscribes by itself: it has left$, a stream of the minutes left, for its template. Fill in imports and the template's expression so the number shows, changes at each tick, and nothing stays behind once the panel closes.
  8. The traders say the header's clock sits still, then jumps. The Clock service keeps the time twice in one subscription: now, plain text, and time, a signal. Nobody touches the board this morning until 08.00. Fill in the header's clock expression so the time is right at every tick.
  9. The tablet now has a cash-summary for the market head. It and the tiles ask for DailyCash and Clock through inject; both are providedIn: 'root' and count themselves with console.count. Fill in the line in CashSummary's metadata so it writes the money taken, with one cash box and one clock.
  10. Each tile now has a Pay button. A tile gets its stall through an input and has an output named paidFor; the board's header writes Paid N of 8 stalls from market.stalls(). Fill in pay() in the tile so both the stall's lamp and the header's number change.
  11. Under the tiles, the vendor's month-summary writes the rent taken each month, and reads only the signal cash.monthly(). The clock ticks until 09.00, and Mrs. Yanti pays at 08.00. Fill in its change detection strategy so the summary is checked only when someone pays.
  12. Closing the books: the board runs from 07.00 to 16.00 with everything found this week. Fill in the four holes so a tick makes the board do no work, a payment rebuilds no tile, the panel stops when it closes, and the board stays right till the afternoon.