Skip to content

Best practice for setting query options that require an input parameter #159

Discussion options

You must be logged in to vote
import { computedAsync } from 'ngxtension/computed-async';

export class ProjectMetricComponent {
    projectId = input.required<Project['id']>();
    readonly #projectService = inject(ProjectService);

    projects = computedAsync(() => this.projectService.listProjectMetrics(this.projectId()).result$);
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@NetanelBasal
Comment options

@unifyiGreenleaf
Comment options

Answer selected by unifyiGreenleaf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants