×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Nilesh Yadav
Added: Jun 14, 2017 7:20 AM
Views: 2
Tags: no tags
  1. import { Component } from '@angular/core';
  2.  
  3. @Component({
  4.         selector: 'my-tuts',
  5.         template:`<h2>{{title}}</h2>
  6.                                 <button (click)="onClick(demoInput.value)">Click Me</button>
  7.                                 <input type="text" #demoInput>`,
  8.                
  9. })
  10. export class TutsComponent{
  11.         public title="mytitle";
  12.        
  13.         onClick(value) {
  14.           console.log('button clicked');
  15.         }
  16. }