Skip to content

Instantly share code, notes, and snippets.

@tkssharma
Created May 16, 2016 07:17
Show Gist options
  • Save tkssharma/7be4f09a261b82554d2193ec211de43a to your computer and use it in GitHub Desktop.
Save tkssharma/7be4f09a261b82554d2193ec211de43a to your computer and use it in GitHub Desktop.
@Component({
selector: 'search-product',
template:
`<div>
<input #prod>
<button (click)="findProduct(prod.value)">Find Product</button>
Product name: {{product.name}}
</div>
`
})
class SearchComponent {
product: Product; // code of the Product class is omitted
findProduct(prodName: string){
// Implementation of the click handler goes here
}
// Other code can go here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment