app-module

Polymer 1.x element for creating script modules


Keywords
Polymer, web-components, modules, script
License
MIT
Install
bower install app-module

Documentation

app-module

Polymer 1.x element for creating script modules.

Usage

1. Creating a module

<app-module namespace="StringUtils">
    <script type="text/app-module">
        exports.trim = function() {
            // ...
        };

        exports.stripWhitespace = function() {
            // ...
        };
    </script>
</app-module>

2. Using third party scripts.

<script type="text/javascript" src="./interact.js" ></script>

<app-module namespace="Interact">
    <script type="text/app-module">
        exports = window.interact;
    </script>
</app-module>

3. Using a module

    <script>
    ...
    var StringUtils = Polymer.Module.import('App.StringUtils');

    var myString = StringUtils.trim(myString);
    ...
    </script>

Install

You can install it by using bower:

bower install app-module