Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(effects): remove redundant standalone flag #4626

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions projects/ngrx.io/content/guide/effects/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ In a service-based application, your components interact with data through many
Imagine that your application manages movies. Here is a component that fetches and displays a list of movies.

<code-example header="movies-page.component.ts">
import { Component, inject } from '@angular/core';
import { Component, inject, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';

@Component({
Expand All @@ -33,12 +33,11 @@ import { CommonModule } from '@angular/common';
{{ movie.name }}
&lt;/li&gt;
`,
standalone: true,
imports: [CommonModule],
})
export class MoviesPageComponent {
export class MoviesPageComponent implements OnInit {
private moviesService = inject(MoviesService);
protected movies: Movie[];
protected movies: Movie[] = [];

ngOnInit() {
this.movieService.getAll()
Expand Down Expand Up @@ -77,7 +76,7 @@ The component has multiple responsibilities:
Effects handle external data and interactions, allowing your services to be less stateful and only perform tasks related to external interactions. Next, refactor the component to put the shared movie data in the `Store`. Effects handle the fetching of movie data.

<code-example header="movies-page.component.ts">
import { Component, inject } from '@angular/core';
import { Component, inject, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';

@Component({
Expand All @@ -86,7 +85,6 @@ import { CommonModule } from '@angular/common';
{{ movie.name }}
&lt;/div&gt;
`,
standalone: true,
imports: [CommonModule],
})
export class MoviesPageComponent implements OnInit {
Expand Down
Loading