Fortunately it’s straightforward to implement this by wrapping the third party component yourself. In this example I’m wrapping the Bootstrap tooltip in a custom Aurelia attribute.
This sample code was originally sourced a stack overflow question and modified to work the way I needed.
The property declarations allow us to pass the relevant parameters that we need to set up the tooltip component through to our custom attribute:
Aside from the standard boilerplate code required to set up a custom attribute the only custom part here is where I hook into the Aurelia pipeline on the attach hook to apply the tooltip to the target element for this attribute:
It is possible to implement many third party components in Aurelia by following the same simple pattern.
Three Simple Steps
- Install the library with JSPM
- Create a custom attribute/element to wrap the component from the library
- Require the custom attribute/element to apply it to your HTML/template