Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import {Component, Input, Output} from '@angular/core';
  2.  
  3. @Component({
  4.   selector: 'my-app',
  5.   template: `
  6.     <h1>Hello {{myvar}}</h1>
  7.     <a href="#" (click)="updatemyvar()">This button will set myvar = 'tony'</a>
  8.    
  9.     <my-cmp [(myvar)]="myvar"></my-cmp>
  10.    
  11.    
  12. `,
  13. })
  14. export class AppComponent  {
  15.   @Input() @Output() myvar: string = "test";
  16.   updatemyvar(){
  17.     this.myvar = "gili";
  18.   }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement