Having the structure below:
/project1
/app
/components
/services
index.html
/project2
/app
/components
/services
index.html
Is it possible to import a component or service from project2 to project1 and vice versa?
You could configure SystemJS to use both folders in your index.html file. This way you will be able to import project elements into another one.
<script>
System.config({
packages: {
'project1/app': {
format: 'register',
defaultExtension: 'js'
},
'project2/app': {
format: 'register',
defaultExtension: 'js'
}
}
});
System.import('project1/app/boot')
.then(null, console.error.bind(console));
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With