External libraries

External libraries

Define a dependencies array to include libraries in your interfaces. These can include:

Include Fliplet approved libraries

Simply list out the names of the libraries you want to use:

Fliplet.Helper({
  name: 'welcome',
  render: {
    template: '<p class="welcome">Hi {! fields.name !}, how are you?</p>'
  },
  configuration: {
    dependencies: ['moment'],
    fields: []
  }
});

Include 3rd-party libraries

Define an object with url and type for each 3rd-party library you want to include:

Fliplet.Helper({
  name: 'welcome',
  render: {
    template: '<p class="welcome">Hi {! fields.name !}, how are you?</p>',
    dependencies: ['fliplet-media']
  },
  configuration: {
    title: 'Dolor sit amet',
    dependencies: [
      { url: 'https://unpkg.com/mithril/mithril.js', type: 'js' },
      { url: 'https://meyerweb.com/eric/tools/css/reset/reset.css', type: 'css' }
    ],
    fields: []
  }
});