gnaeus / knockout-decorators

Decorators for use Knockout JS in TypeScript and ESNext environments
MIT License
43 stars 8 forks source link

have any example about reuse some components with params in a page view #22

Open i2Echo opened 4 years ago

i2Echo commented 4 years ago
import { Test } from "./components/test/test";
import { component } from 'knockout-decorators';

@component("app", `
  <div id="app">
    <test></test>
  </div>   
`)
export class App {
    constructor() {  
       new Test();
    }
}

It's work.

But, if i wanna give some params to test component, how can i do that; and more 'test' compoent instance with diffrient params in that page?

bokc commented 3 years ago

This API was very interresting. But it will be very helpfull to have a complet exemple of use.