0.0.3 • Published 6 years ago
storybook-addon-for-old-angularjs v0.0.3
Storybook Addon for AngularJS (1.x)
Note This addon is intended to be used with
@storybook/html, available since Storybook 4.
Installation
Use your favorite 📦 package manager to install the addon in your project's devDependencies:
npm:
npm install --save-dev storybook-addon-angularjsYarn:
yarn add --dev storybook-addon-angularjsUsage
Create your stories with:
import { storiesOf } from "@storybook/html";
import { withKnobs, text, number } from "@storybook/addon-knobs";
import { action } from "@storybook/addon-actions";
import { forModule } from "storybook-addon-angularjs";
storiesOf("Components/Demo", module)
  .addDecorator(withKnobs)
  .add(
    "default",
    forModule("myApp").createElement(compile => {
      const name = text("Name", "Jane");
      const foo = {
        bar: number("Value", 20, { range: true, min: 0, max: 30, step: 1 })
      };
      const onEvt = action("clicked");
      return compile`<demo-component name="${name}" foo="${foo}" on-ev="${onEvt}(num, name)"></demo-component>`;
    })
  );See a full working example here.
License
Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.
0.0.3
6 years ago