Skip to content

Commit 7a828ba

Browse files
committed
chore: update readme
1 parent 11f2285 commit 7a828ba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ const contentNodes = aggregationTemplate.statements({ AGGREGATION: 'content', VA
2424
const footerNodes = aggregationTemplate.statements({ AGGREGATION: 'footer' });
2525
```
2626

27-
#### Casting and expression templates
27+
#### Casting and member templates
2828
```typescript
2929
import { template } from "@propero/typescript-transformer-source-templates";
30-
import { ObjectLiteralExpression } from "typescript";
30+
import { MethodDeclaration } from "typescript";
3131

32-
const objectTemplate = template("{ render() {RENDER_CODE} }");
33-
const render = objectTemplate.expression<ObjectLiteralExpression>({ RENDER_CODE: generateRenderCode() }).properties.find(it => it.name === "render");
32+
const methodTemplate = template("render() {RENDER_CODE}");
33+
const render = methodTemplate.objectMember<MethodDeclaration>({ RENDER_CODE: "return 'hello world';" });
3434
```

0 commit comments

Comments
 (0)