tomastrajan / angular-ngrx-material-starter

Angular, NgRx, Angular CLI & Angular Material Starter Project
https://tomastrajan.github.io/angular-ngrx-material-starter
MIT License
2.83k stars 917 forks source link

class active on Todos filter not showing up #524

Open bhahn57570 opened 4 years ago

bhahn57570 commented 4 years ago

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 commented 4 years ago

Hi @bhahn57570 !

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

Cheers!

bhahn57570 commented 4 years ago

Hi Sorry for the late response, I am quite busy these days.

Yes, I would like to submit a pull request, I will do it next week. Is it ok for you?

I am just not familiar with GitHub, I just have to push on a specific branch and after asking you for a pull request that it?

Thanks a lot for the project it helped me a lot to start with angular.

Cheers!

Le dim. 10 mai 2020 à 13:58, Tomas Trajan notifications@github.com a écrit :

Hi @bhahn57570 https://github.com/bhahn57570 !

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

Cheers!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tomastrajan/angular-ngrx-material-starter/issues/524#issuecomment-626317013, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJKGDWIXBCOVM5TL6YYPHKLRQ2JIBANCNFSM4M3WRIXA .

tomastrajan commented 4 years ago

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