Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@fatihdgn
Last active May 30, 2019 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fatihdgn/68e78aa3acd9e9fb605af959f9c8ffa9 to your computer and use it in GitHub Desktop.
Save fatihdgn/68e78aa3acd9e9fb605af959f9c8ffa9 to your computer and use it in GitHub Desktop.
Create an Angular Component Library w/ StoryBook
<button (click)="onclick()">
{{text}}
</button>
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'my-button',
templateUrl: './button.component.html',
styleUrls: ['./button.component.css']
})
export class ButtonComponent implements OnInit {
@Input() text: string;
@Output() click: EventEmitter<void> = new EventEmitter();
constructor() { }
ngOnInit() {
}
onclick(){
this.click.emit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment