Last active
October 20, 2022 16:32
-
-
Save robwormald/d1b24a19ed94a16a4f7697a7cf2277a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'wt-greeting', | |
template: (ctx: WtGreeting) => ngHtml`<h1>Hello ${uppercase(ctx.name)}</h1>` | |
}) | |
class WtGreeting { | |
@Input() name: string; | |
} | |
@Component({ | |
selector: 'wt-root', | |
template: (ctx:AppComponent) => ngHtml` | |
<wt-greeting name="Static Value"></wt-greeting> | |
<wt-greeting name=${ctx.dynamicValue}></wt-greeting> | |
` | |
}) | |
class AppComponent { | |
@Input() dynamicValue = string; | |
} | |
function upperCase(value: string){ | |
return value.toUpperCase(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment