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: 2 comments 2 replies

Comment options

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

@unifyiGreenleaf
Comment options

Answer selected by unifyiGreenleaf
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants