littlehand
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

littlehand

A Shorthand Component syntax for Angular 2

A util to quickly and conveniently create dumb little components.

Install

npm i littlehand

Usage
import little from 'littlehand'

// API
// little(selector: string, template: string): Component;

const Product = little('my-product', `
  <div class="Product">
    <h4 class="Product--name">{{ name }}</h4>
    <button class="Product--buyBtn" (click)="buy.emit()">{{ buyText }}</button>
  </div>    
`);

// little auto-infers the inputs and outputs of your component
// so it found two inputs: name, buyText
// and one output: buy

// Go ahead and use it, it's just a normal Component.
@Component({
  selector: 'my-app',
  directives: [Product],
  template: `<my-product name="Toothpaste" buyText="Buy Now!" (buy)="onBuy()">`
})
class MyApp {}

Readme

Keywords

none

Package Sidebar

Install

npm i littlehand

Weekly Downloads

1

Version

0.0.3

License

MIT

Last publish

Collaborators

  • timkindberg