Module: decorators/state
Functions
state
▸ state(target, key, descriptor?): void
Description
@state is used to decorate a class property as a state field.
Example
@injectable()
class Counter {
@state
count = 0;
}
const app = testBed({
modules: [],
main: Counter,
});
expect(app.instance.count).toBe(0);
Parameters
| Name | Type |
|---|---|
target | object |
key | string | symbol |
descriptor? | PropertyDescriptor<any> |
Returns
void