@molecule/app-job-listing-row-angular

Feature · job-listing-row · App (browser) · v1.1.3 · Apache-2.0

Job-board row with title, company, location, type, salary range, posted date

npm install @molecule/app-job-listing-row-angular

npm · Source on GitHub

How it works

@molecule/app-job-listing-row-angular is a ready-made job-listing-row feature for the app (browser) side. It composes the core interfaces it needs, so it works with whichever providers your app has bonded.

import { Component } from '@angular/core'
import { JobListingRow } from '@molecule/app-job-listing-row-angular'

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [JobListingRow],
  template: `
    <div
      mol-job-listing-row
      title="Senior Frontend Engineer"
      company="Acme Corp"
      location="Remote · US"
      type="Full-time"
      salary="$130k–$160k"
      postedAt="2 days ago"
      [onClick]="openJob"
    >
      <button slot="actions" type="button">Apply</button>
    </div>
  `,
})
export class App {
  openJob(): void {
    // navigate to the job…
  }
}

Works with: @molecule/app-angular, @molecule/app-ui, @molecule/app-ui-angular

Reference

Angular job-board listing row — the counterpart of @molecule/app-job-listing-row-react: the same props and the same DOM for the same input.

Exports JobListingRow — title + company + location + employment type + salary + posted date, with optional leading logo, tag chips, and right-side actions.

Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit src/index.ts JSDoc, not this file.

Quick Start

import { Component } from '@angular/core'
import { JobListingRow } from '@molecule/app-job-listing-row-angular'

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [JobListingRow],
  template: `
    <div
      mol-job-listing-row
      title="Senior Frontend Engineer"
      company="Acme Corp"
      location="Remote · US"
      type="Full-time"
      salary="$130k–$160k"
      postedAt="2 days ago"
      [onClick]="openJob"
    >
      <button slot="actions" type="button">Apply</button>
    </div>
  `,
})
export class App {
  openJob(): void {
    // navigate to the job…
  }
}

Type

feature

Installation

npm install @molecule/app-job-listing-row-angular @angular/common @angular/core @angular/platform-browser @molecule/app-angular @molecule/app-ui @molecule/app-ui-angular

API

Interfaces

JobListingRowProps

Props for JobListingRow — the same props @molecule/app-job-listing-row-react accepts. Node-valued props (title, company, location, type, salary, postedAt, leading, actions, tags) are projected content in Angular (an input cannot carry a node): pass a string value through the input, and element content in the host template as [slot=<name>] content.

interface JobListingRowProps {
  /** Title of the role; element content is projected as `[slot=title]` content. */
  title?: unknown
  /** Company / employer display; projected as `[slot=company]` content. */
  company?: unknown
  /** Location string; projected as `[slot=location]` content. */
  location?: unknown
  /** Employment type; projected as `[slot=type]` content. */
  type?: unknown
  /** Salary range display; projected as `[slot=salary]` content. */
  salary?: unknown
  /** Posted-at display; projected as `[slot=postedAt]` content. */
  postedAt?: unknown
  /** Optional company logo / icon, projected as `[slot=leading]` content. */
  leading?: unknown
  /** Optional right-side actions, projected as `[slot=actions]` content. */
  actions?: unknown
  /** Tags / chips, projected as `[slot=tags]` content. */
  tags?: unknown
  /**
   * Activates the row: while it is set, an empty, transparent native button
   * covers the whole row and calls this on click — the whole row is the click
   * target, and Enter / Space activate the button natively. The row is named
   * by the title (the `<h3>` itself takes the id the button points at with
   * `aria-labelledby`); the `actions` and `tags` slots sit above the button
   * and keep their own clicks.
   */
  onClick?: () => void
  /** Extra classes. */
  className?: string
}

Classes

JobListingRow

JobListingRow component.

Job-board row — title + company + location + type + salary + posted date with optional leading logo, tag chips, and right-side actions. The host IS the root <div> (div[mol-job-listing-row]), matching React's root exactly.

The location value is prefixed with the same hardcoded 📍 glyph React renders, and the meta fields carry the same literal middle-dot separators (there is no prop to change or localise them).

onClick covers the whole row with an empty, transparent native button that activates it — the whole row is the click target, named by the title (the <h3> itself takes the id the button points at with aria-labelledby), with the inner controls above it keeping their own clicks.

The node props are projected slots: leading, company, location, type, salary, postedAt, tags and actions each render inside the wrapper element React renders for them (React renders every node prop of this row inside its own element). String inputs render as text instead — React's truthiness branch applies: an empty string renders nothing. The capture wrappers reconcile against that in the placement function registered in the constructor (each wrapper renders its own text first, so the slot is read past that one leading node).

@Component({
  selector: 'div[mol-job-listing-row]',
  standalone: true,
  hostDirectives: [MolPlacement],
  inputs: [
    'title',
    'company',
    'location',
    'type',
    'salary',
    'postedAt',
    'leading',
    'actions',
    'tags',
    'onClick',
    'className',
  ],
  host: {
    '[class]': 'classes()',
  },
  template: `@if (hasOnClick()) {
      <!-- mol-bespoke-button: the whole row is the hit area, not a CTA — an
         empty, transparent button over the row; the inline background/border/
         padding are native resets. The style values carry the form React's
         attribute shows after CSSOM (Angular writes the attribute raw): the
         border is its initial "none" style at "medium" width, padding the
         pixel form of 0 — visually identical, textually equal to React. -->
      <button
        type="button"
        [attr.aria-labelledby]="nameId"
        data-mol-id="job-listing-row-open"
        (click)="handleClick()"
        [class]="openClasses()"
        style="background: transparent; border: medium; padding: 0px;"
      ></button>
    }
    <div #leadingWrap [class]="leadingClasses()">
      {{ leadingText() }}
      <ng-content select="[slot=leading]"></ng-content>
    </div>
    <div [class]="stackClasses()">
      <h3 [attr.id]="nameId" [class]="titleClasses()">
        {{ titleText() }}
        <ng-content select="[slot=title]"></ng-content>
      </h3>
      <span #companyWrap [class]="companyClasses()">
        {{ companyText() }}
        <ng-content select="[slot=company]"></ng-content>
      </span>
      <div [class]="metaClasses()">
        <span #locationWrap [class]="locationClasses()">
          {{ '📍 ' + locationText() }}
          <ng-content select="[slot=location]"></ng-content>
        </span>
        <span #typeWrap [class]="typeClasses()">
          {{ '· ' + typeText() }}
          <ng-content select="[slot=type]"></ng-content>
        </span>
        <span #salaryWrap [class]="salaryClasses()">
          {{ '· ' + salaryText() }}
          <ng-content select="[slot=salary]"></ng-content>
        </span>
        <span #postedAtWrap [class]="postedAtClasses()">
          {{ '· ' + postedAtText() }}
          <ng-content select="[slot=postedAt]"></ng-content>
        </span>
      </div>
      <div #tagsWrap [class]="tagsClasses()">
        {{ tagsText() }}
        <ng-content select="[slot=tags]"></ng-content>
      </div>
    </div>
    <div #actionsWrap [class]="actionsClasses()">
      {{ actionsText() }}
      <ng-content select="[slot=actions]"></ng-content>
    </div>`,
})
export class JobListingRow {
  title?: unknown
  company?: unknown
  location?: unknown
  type?: unknown
  salary?: unknown
  postedAt?: unknown
  leading?: unknown
  actions?: unknown
  /** Tags / chips (string as text; nodes are `[slot=tags]` content). */
  tags?: unknown
  onClick?: () => void
  /** Extra classes. */
  className?: string

  private static nextNameId = 0

  protected readonly nameId = `mol-job-listing-row-title-${JobListingRow.nextNameId++}`

  @ViewChild('leadingWrap') leadingWrap?: ElementRef<HTMLElement>
  @ViewChild('companyWrap') companyWrap?: ElementRef<HTMLElement>
  @ViewChild('locationWrap') locationWrap?: ElementRef<HTMLElement>
  @ViewChild('typeWrap') typeWrap?: ElementRef<HTMLElement>
  @ViewChild('salaryWrap') salaryWrap?: ElementRef<HTMLElement>
  @ViewChild('postedAtWrap') postedAtWrap?: ElementRef<HTMLElement>
  @ViewChild('tagsWrap') tagsWrap?: ElementRef<HTMLElement>
  @ViewChild('actionsWrap') actionsWrap?: ElementRef<HTMLElement>

  constructor() {
    usePlacement((hasContent) => this.reconcile(hasContent))
  }

  /** The current class map. */
  cm(): UIClassMap {
    return getClassMap()
  }

  classes(): string {
    return this.cm().cn(
      this.cm().flex({ align: 'start', gap: 'md' }),
      this.cm().sp('p', 3),
      this.hasOnClick() ? this.cm().position('relative') : undefined,
      this.className,
    )
  }

  hasOnClick(): boolean {
    return Boolean(this.onClick)
  }

  openClasses(): string {
    return this.cm().cn(this.cm().position('absolute'), this.cm().inset0, this.cm().cursorPointer)
  }

  /** Computes the stack's class (`cm.flex1` + `cm.stack(1)`). */
  stackClasses(): string {
    return this.cm().cn(this.cm().flex1, this.cm().stack(1))
  }

  titleClasses(): string {
    return this.cm().cn(this.cm().textSize('base'), this.cm().fontWeight('semibold'))
  }

  metaClasses(): string {
    return this.cm().flex({ align: 'center', gap: 'sm', wrap: 'wrap' })
  }

  /** Computes the leading wrapper's class (`cm.shrink0`). */
  leadingClasses(): string {
    return this.cm().cn(this.cm().shrink0)
  }

  /** Computes the company span's class (`cm.textSize('sm')`). */
  companyClasses(): string {
    return this.cm().cn(this.cm().textSize('sm'))
  }

  /** Computes the location span's class (`cm.textSize('xs')`). */
  locationClasses(): string {
    return this.cm().cn(this.cm().textSize('xs'))
  }

  /** Computes the type span's class (`cm.textSize('xs')`). */
  typeClasses(): string {
    return this.cm().cn(this.cm().textSize('xs'))
  }

  /** Computes the posted-at span's class (`cm.textSize('xs')`). */
  postedAtClasses(): string {
    return this.cm().cn(this.cm().textSize('xs'))
  }

  salaryClasses(): string {
    return this.cm().cn(this.cm().textSize('xs'), this.cm().fontWeight('semibold'))
  }

  tagsClasses(): string {
    return this.cm().cn(
      this.cm().flex({ align: 'center', gap: 'xs', wrap: 'wrap' }),
      this.cm().position('relative'),
    )
  }

  actionsClasses(): string {
    return this.cm().cn(
      this.cm().flex({ align: 'center', gap: 'sm' }),
      this.cm().shrink0,
      this.cm().position('relative'),
    )
  }

  private textOf(value: unknown): string {
    return typeof value === 'string' || typeof value === 'number' ? String(value) : ''
  }

  /** The title input's text. */
  titleText(): string {
    return this.textOf(this.title)
  }

  /** The company input's text. */
  companyText(): string {
    return this.textOf(this.company)
  }

  /** The location input's text. */
  locationText(): string {
    return this.textOf(this.location)
  }

  /** The type input's text. */
  typeText(): string {
    return this.textOf(this.type)
  }

  /** The salary input's text. */
  salaryText(): string {
    return this.textOf(this.salary)
  }

  /** The postedAt input's text. */
  postedAtText(): string {
    return this.textOf(this.postedAt)
  }

  /** The leading input's text. */
  leadingText(): string {
    return this.textOf(this.leading)
  }

  /** The actions input's text. */
  actionsText(): string {
    return this.textOf(this.actions)
  }

  /** The tags input's text. */
  tagsText(): string {
    return this.textOf(this.tags)
  }

  handleClick(): void {
    this.onClick?.()
  }

  private reconcile(hasContent: SlotReader): void {
    const leading = this.leadingWrap?.nativeElement
    const company = this.companyWrap?.nativeElement
    const location = this.locationWrap?.nativeElement
    const type = this.typeWrap?.nativeElement
    const salary = this.salaryWrap?.nativeElement
    const postedAt = this.postedAtWrap?.nativeElement
    const tags = this.tagsWrap?.nativeElement
    const actions = this.actionsWrap?.nativeElement
    setElementPresent(leading, this.leadingText() !== '' || hasContent(leading, 1))
    setElementPresent(company, this.companyText() !== '' || hasContent(company, 1))
    setElementPresent(location, this.locationText() !== '' || hasContent(location, 1))
    setElementPresent(type, this.typeText() !== '' || hasContent(type, 1))
    setElementPresent(salary, this.salaryText() !== '' || hasContent(salary, 1))
    setElementPresent(postedAt, this.postedAtText() !== '' || hasContent(postedAt, 1))
    setElementPresent(tags, this.tagsText() !== '' || hasContent(tags, 1))
    setElementPresent(actions, this.actionsText() !== '' || hasContent(actions, 1))
  }
}

(Member comments are shortened to their first sentence, and the 30 longest are left out to fit; the full declaration is in node_modules/@molecule/app-job-listing-row-angular/dist/job-listing-row.component.d.ts.)

Injection Notes

Requirements

Peer dependencies:

  • @angular/common ^22.0.0
  • @angular/core ^22.0.0
  • @angular/platform-browser ^22.0.0
  • @molecule/app-angular ^3.13.0 || ^4.0.0
  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-angular ^1.1.0

Runtime Dependencies

  • @angular/common
  • @angular/core
  • @angular/platform-browser
  • @molecule/app-angular
  • @molecule/app-ui
  • @molecule/app-ui-angular

Requires a wired ClassMap bond — getClassMap() throws before wiring.

The location value is prefixed with a hardcoded 📍 glyph and the meta fields are joined with literal middle-dot separators; there is no prop to change or localise those separators.

onClick makes the whole row clickable through a transparent native button over it — the row is named by the title (the <h3> itself takes the id the button points at with aria-labelledby), and the inner controls sit above it and keep their own clicks. Put a real link or button in actions for the other row actions.

Node-valued props are projected content: title, company, location, type, salary, postedAt, leading, tags and actions are selected by [slot=<name>]; string inputs render as text with React's truthiness branch (an empty string renders nothing).