File tree Expand file tree Collapse file tree 2 files changed +18
-39
lines changed
angular-redux-demo/src/app Expand file tree Collapse file tree 2 files changed +18
-39
lines changed Original file line number Diff line number Diff line change 1
1
import { Component } from '@angular/core'
2
- import { injectSelector , injectDispatch } from "@reduxjs/angular-redux" ;
2
+ import { injectSelector , injectDispatch } from "@reduxjs/angular-redux" ;
3
3
import { decrement , increment } from './store/counter-slice'
4
4
import { RootState } from './store'
5
5
6
6
@Component ( {
7
7
selector : 'app-root' ,
8
8
standalone : true ,
9
- imports : [ ] ,
10
9
template : `
11
- <div>
12
- <div>
13
- <button
14
- aria-label="Increment value"
15
- (click)="dispatch(increment())"
16
- >
17
- Increment
18
- </button>
19
- <span>{{ count() }}</span>
20
- <button
21
- aria-label="Decrement value"
22
- (click)="dispatch(decrement())"
23
- >
24
- Decrement
25
- </button>
26
- </div>
27
- </div>
10
+ <button (click)="dispatch(increment())">
11
+ Increment
12
+ </button>
13
+ <span>{{ count() }}</span>
14
+ <button (click)="dispatch(decrement())">
15
+ Decrement
16
+ </button>
28
17
`
29
18
} )
30
19
export class AppComponent {
Original file line number Diff line number Diff line change @@ -37,31 +37,21 @@ The following Angular component works as-expected:
37
37
38
38
``` angular-ts
39
39
import { Component } from '@angular/core'
40
- import {injectSelector, injectDispatch} from "@reduxjs/angular-redux";
41
- import { decrement, increment, RootState } from './store/counter-slice'
40
+ import { injectSelector, injectDispatch } from "@reduxjs/angular-redux";
41
+ import { decrement, increment } from './store/counter-slice'
42
+ import { RootState } from './store'
42
43
43
44
@Component({
44
45
selector: 'app-root',
45
46
standalone: true,
46
- imports: [],
47
47
template: `
48
- <div>
49
- <div>
50
- <button
51
- aria-label="Increment value"
52
- (click)="dispatch(increment())"
53
- >
54
- Increment
55
- </button>
56
- <span>{{ count() }}</span>
57
- <button
58
- aria-label="Decrement value"
59
- (click)="dispatch(decrement())"
60
- >
61
- Decrement
62
- </button>
63
- </div>
64
- </div>
48
+ <button (click)="dispatch(increment())">
49
+ Increment
50
+ </button>
51
+ <span>{{ count() }}</span>
52
+ <button (click)="dispatch(decrement())">
53
+ Decrement
54
+ </button>
65
55
`
66
56
})
67
57
export class AppComponent {
You can’t perform that action at this time.
0 commit comments