Created
June 6, 2022 15:56
-
-
Save Madhust/0352c4b885cf344b347260618e6e4952 to your computer and use it in GitHub Desktop.
stateless-standalone-component
This file contains hidden or 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 { StatelessComponent } from '@protools/angular'; | |
@Component({ | |
selector: 'app-view', | |
standalone: true, | |
imports: [CommonModule], | |
templateUrl: './view.component.html', | |
styleUrls: ['./view.component.scss'] | |
}) | |
@StatelessComponent() | |
export class ViewComponent { | |
@Input() | |
title = 'stateless-stand-alone-experiment'; | |
@Output() | |
titleChanged = new EventEmitter() | |
increment() { | |
// StatelessComponent decorator will not allow title mutation and throws runtime error. | |
this.title = "Title Changed"; | |
this.titleChanged.emit('Title Changed'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment