Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Component({
- selector: 'app-component',
- template: `
- {{ compile(name) }}
- <input [(ngModel)]="value"/>
- <button (click)="changeName()">Change the Name</button>
- `,
- changeDetection: ChangeDetectionStrategy.OnPush,
- })
- export class DemoComponent {
- public name = 'Bob';
- public value: string;
- public compile(name: string): string {
- console.log('executed');
- return btoa(name);
- }
- public changeName(): void {
- this.name = this.value;
- }
- }
Add Comment
Please, Sign In to add comment