Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
G
General documentation
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 23
    • Issues 23
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 2
    • Merge Requests 2
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Packages
    • Packages
    • Container Registry
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Documentation
  • General documentation
  • Wiki
  • Helpers functions

Helpers functions

Last edited by Poggioli Dec 19, 2019
Page history

Helpers fonctions

Those function are inclued in the core.

Function Parameters Description
uniqID create an uniq ID, used for example to associate input with label
stringToDom html parse html string and return DOM fragment
evalTemplateString str, variables = {} eval a string as an es6 template string. example: evalTemplateString('name: ${first} ${last}', {first: 'John', last: 'Doe'})
importCSS [...stylesheets] add style in document if not present
importJS [...script] add script in document if not present

If you're writing a component

Creating a component, you should import those function like this :

import { Helpers } from "https://unpkg.com/@startinblox/core@0.9";

You should always use importCSS and importJS to make your extra importation. Otherwise, you'll get this king of message :

Le chargement du module à l’adresse « https://the/road/to/your/extra/script » a été bloqué en raison d’un type MIME interdit (« text/html »).
Clone repository
  • Build a sib application from scratch
  • Components
    • SiB Ac Checker
    • SiB Delete
    • SiB Display
    • SiB Form
    • SiB Map
    • SiB Widget
    • Sib Calendar
  • Contribution guidelines
  • Documentation Component Model
  • Events
  • Glossary
  • Helpers functions
  • Home
  • How to make components
More Pages

New Wiki Page

Tip: You can specify the full path for the new file. We will automatically create any missing directories.