This addon lets you use WebComponents built with Stencil.js in your Ember applications.
- Ember.js v2.18 or above
- Ember CLI v2.13 or above
ember install ember-cli-native-stencil
⚠️ Please make sure you have TypeScript installed in the destination app. This will change in the future.
This addon works at build time, which means that once it is installed, there's nothing left to do from the developer.
For the moment, if you want your application to act upon custom events, you can do so as always in your ember app (see example below for a refresher).
Remind that in order to retrieve the custom data that your custom event may carry, you will have to do one of the following:
// Option 1: from the component
//
// Your template file looks like this
// <my-web-component custom-change={{action 'myCustomHandler'}} />
//
// Your JS action should look like this
myCustomHandler(event) {
let data = event.target.value
}
// Option 2: from the template
//
// Your template file looks like this
// <my-web-component custom-change={{action 'myCustomHandler' value="target.value"}} />
//
// Your JS action should look like this
myCustomHandler(customData) {
// customData is already bound to the correct value
}
This project is licensed under the MIT License.