javascript - How to use external custom element (plugin) in Aurelia app? -
i've defined custom element in github repo. jspm install'd said element in app.
what correct way of importing element in other app? when call aurelia.use.plugin('aurelia-custom-element') in app config, says can't find aurelia-custom-element.js.
aurelia-custom-element.html:
<template> <div>hello world, aurelia custom element!</div> </template> aurelia-custom-element.js:
import {customelement, bindable} 'aurelia-framework'; @customelement('aurelia-custom-element') export class aureliacustomelement { } index.js:
export * './aurelia-custom-element'; export function configure(config){ config.globalresources('./aurelia-custom-element'); }
what put aurelia.use.plugin('[here]') should match jspm installed.
for example, if github repo containing plugin https://github.com/uavalos/mega-plugin, execute jspm install github:uavalos/mega-plugin install plugin. load plugin you'd write aurelia.use.plugin('uavalos/mega-plugin').
if share url of plugin provide more specific help.
Comments
Post a Comment