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

class active on Todos filter not showing up #524

Open
bhahn57570 opened this issue May 7, 2020 · 3 comments
Open

class active on Todos filter not showing up #524

bhahn57570 opened this issue May 7, 2020 · 3 comments

Comments

@bhahn57570
Copy link

The view todos-container.component.html is giving an error on

[ngClass]="{ active: todos.filter === 'ACTIVE' }

Indeed todos.filter does not exist instead add in todos-container.component.ts

filter$: Observable<TodosFilter>; .... ngOnInit() { this.todos$ = this.store.pipe(select(selectTodos)); this.filter$ = this.store.pipe(select(selectTodosFilter)); this.removeDoneDisabled$ = this.store.pipe( select(selectRemoveDoneTodosDisabled) ); }

And in the view

<button mat-menu-item (click)="onFilterTodos('ALL')" [class.active]="(filter$ | async) === 'ALL'" rtl>

The ngClass directive is removed because in the official documentation it's written

The NgClass directive can be used as an alternative to direct [class] bindings. However, using the above class binding syntax without NgClass is preferred because due to improvements in class binding in Angular, NgClass no longer provides significant value, and might eventually be removed in the future.

@tomastrajan
Copy link
Owner

Hi @bhahn57570 !

Sounds good, would you be willing to submit a pull request to fix this?

Cheers!

@bhahn57570
Copy link
Author

bhahn57570 commented May 14, 2020 via email

@tomastrajan
Copy link
Owner

Hi @bhahn57570 !

No worries, there is enough time!

The way to do it on github is first to fork this repository into your account. Then you clone it, make a branch and commit a fix to your repository (project fork)

Once you do it, Github will allow you to open pull request based on your fork, you should see that button just by visiting this repository.

Hope that helps!

Cheers,
Tomas

bhahn57570 pushed a commit to bhahn57570/angular-ngrx-material-starter that referenced this issue Jul 1, 2020
tomastrajan added a commit that referenced this issue Nov 11, 2020
fix(#524): class active on Todos filter not showing up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants