Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import {Component, Input, Output} from '@angular/core';
- @Component({
- selector: 'my-app',
- template: `
- <h1>Hello {{myvar}}</h1>
- <a href="#" (click)="updatemyvar()">This button will set myvar = 'tony'</a>
- <my-cmp [(myvar)]="myvar"></my-cmp>
- `,
- })
- export class AppComponent {
- @Input() @Output() myvar: string = "test";
- updatemyvar(){
- this.myvar = "gili";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement