Getting Started
Step 1: Install Fudgel or include it into your project. This can
take several forms, depending on your needs.
-
IIFE / global, available as
window.Fudgel
:
-
Module in browser either as a standalone tag or perhaps
loaded through an import:
-
Locally as a package or module using your favorite tools:
npm install fudgel
yarn add fudgel
bower install fudgel
Step 2: At this point you have access to the
Fudgel
object or the module's exports. It's time to
write your first controller. Select the chunk of code that best
fits your needs.
// Module
import { component } from './fudgel.min.js';
component('my-custom-component', {
template: `Hello {{audience}}`
}, class {
audience = 'world';
});
// Vanilla JavaScript using window.Fudgel
window.Fudgel.component('my-custom-component', {
template: `Hello {{audience}}`
}, class {
audience = 'world';
});
// TypeScript with decorators
import { Component } from 'fudgel';
@Component('my-custom-component', {
template: `Hello {{audience}}`
})
export class MyCustomComponent {
audience = 'world';
}
Step 3: You've made a custom element. For more fun, take a look
at the rest of the things Fudgel can do to save you time.