Switch branches/tags
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
src
tests
.dojorc
.gitignore
README.md
package-lock.json
package.json
tsconfig.json
tslint.json

README.md

Dojo Custom Element Menu Demo

Implementation of a basic menu widget that demonstrates using as custom elements against standard Dojo widgets.

Pre-requisites

@dojo/cli must be installed globally:

npm install @dojo/cli -g

Usage

To use the custom-element-menu, clone the examples repository and install the npm dependencies:

git clone https://github.com/dojo/examples
cd examples/custom-element-menu
npm install

To run the application simply run the dojo build.

npm run build

Open the dist directory using a local webserver.

Features

This package demonstrates how to use Dojo widgets as a custom element.

Notice src/widgets/createMenuElement.ts and src/widgets/createMenuItemElement.ts describe the custom elements. To build the custom elements, the npm run build command above first runs dojo build and then

dojo build --element=src/widgets/createMenuItemElement.ts
dojo build --element=src/widgets/createMenuElement.ts

Those CLI build commands use webpack to create bundles in the dist directory for each custom element. To use those custom elements in your own HTML page, import the custom elements' HTML files:

<link rel="import" href="./dist/menu/menu.html" />
<link rel="import" href="./dist/menu-item/menu-item.html" />

How do I contribute?

We appreciate your interest! Please see the Dojo Meta Repository for the Contributing Guidelines and Style Guide.

Installation

To start working with this package, clone the repository and run npm install.

In order to build the project run dojo build.

Testing

Test cases MUST be written using Intern using the Object test interface and Assert assertion interface.

You can test custom element menu locally using the @dojo/cli-test-intern command:

dojo test -a

Licensing Information

© 2018 JS Foundation. New BSD license.