Classes / Ladybug.Utils

OVERVIEW

Just a namespace for utility functions.

BASIC USAGE

Check the Class Methods below for more details.

CLASS METHODS

function compileTemplate(selector)

Compile a template from an existing element.

The element must be an script with a type="text/javascript" attribute.

Available options

  • selector The selector for an existing element

Code sample

Compile a simple template

<script type="text/template" id="page-home">
    <h1>Hello World!</h1>
</script>

With the code

var template = Ladybug.Utils.compileTemplate('#page-home');

function titleCase(str)

Capitalizes an string with Title Case format.

Available options

  • str String to capitalize

CLASS MEMBERS

No public Class members

Go back to previous page