Skip to content

Commit daf716b

Browse files
committed
docs: update README
1 parent 2916308 commit daf716b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,19 +101,19 @@ counter.component.ts
101101
selector: 'app-counter',
102102
template: `
103103
<button (click)="decrement()">-</button>
104-
<span>Current Count: {{ counter }}</span>
104+
<span>Current Count: {{ counter() }}</span>
105105
<button (click)="increment()">+</button>
106106
`,
107107
})
108108
export class CounterComponent {
109-
@Input() counter = 0;
109+
counter = model(0);
110110

111111
increment() {
112-
this.counter += 1;
112+
this.counter.set(this.counter() + 1);
113113
}
114114

115115
decrement() {
116-
this.counter -= 1;
116+
this.counter.set(this.counter() + 1);
117117
}
118118
}
119119
```
@@ -126,13 +126,13 @@ import { CounterComponent } from './counter.component';
126126

127127
describe('Counter', () => {
128128
test('should render counter', async () => {
129-
await render(CounterComponent, { componentProperties: { counter: 5 } });
129+
await render(CounterComponent, { inputs: { counter: 5 } });
130130

131131
expect(screen.getByText('Current Count: 5'));
132132
});
133133

134134
test('should increment the counter on click', async () => {
135-
await render(CounterComponent, { componentProperties: { counter: 5 } });
135+
await render(CounterComponent, { inputs: { counter: 5 } });
136136

137137
const incrementButton = screen.getByRole('button', { name: '+' });
138138
fireEvent.click(incrementButton);

0 commit comments

Comments
 (0)