3
votes

I have components that has dynamic parts with compose. The dynamic parts are in other modules i.e. node projects.

If I want to use a custom element in a page like: <my-custom-element body.bind="someVariableContainingThePath"></my-custom-element>

I get an error saying that the viewmodel specified in someVariableContainingThePath cannot be found in ./my-custom-element/someVariableContainingThePath.

What is the recommended way to deal with paths when using compose element.

I'm using webpack.

Is there a way to alias a module.

So can set someVariableContainingThePath='moduleA' and then specify that moduleA = /some/path/my-body-custom-element ?

1

1 Answers

0
votes

For webpack bundling you have to give it a hint. Otherwise your view will not get bundled. you can add your component to globalResourses when configuring aurelia http://aurelia.io/docs/fundamentals/app-configuration-and-startup#making-resources-global

You have to decorate your module names with PLATFORM.modulename as in .globalResources(PLATFORM.modulename('my-module'))