View message.component.ts
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
import { Component, OnInit, ViewEncapsulation, Input, HostListener, EventEmitter, Output } from "@angular/core"; | |
@Component({ | |
selector: "custom-message", | |
template: ` | |
<p [class]="type"> | |
{{message}} | |
</p> | |
`, | |
styles: [ |
View basic-component.html
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
<template id="my-custom-component"> | |
<span></span> | |
</template> | |
<script type="text/javascript"> | |
class MyCustomComponent extends HTMLElement { | |
constructor() { | |
super(); | |
const template = document.getElementById('my-custom-component'); | |
const templateContent = template.content; |
View stencil-example-component.tsx
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
import { Component, Prop, State } from '@stencil/core'; | |
@Component({ | |
tag: 'my-custom-button', | |
styleUrl: 'my-custom-button.scss' | |
}) | |
export class MyCustomButtonComponent { | |
@Prop() myCustomAttribute: string; | |
@State() checked: boolean; |
NewerOlder