Comments (7)
I have used http-server --cors
for years and it works. My guess is that you're loading from a different server instead of http-server, such as ng serve
or something else. The next step I'd take to debug is to check whether the URL is correct and whether a response header Access-Control-Allow-Origin is being sent by checking the Network tab of the browser devtools.
Regarding registering the angularjs application, I recommend not doing a "named register," but instead an anonymous register.
// Don't do this
System.register('angjs', [], function() {})
// Do this instead
System.register([], function () {})
Then add angjs
to your import map and run the following in the browser console:
System.import('angjs').then(ns => {
console.log('angjs module', ns)
})
The logged object should have the bootstrap, mount, and unmount functions.
from coexisting-angular-microfrontends.
Run npm run build:single-spa
in each of the angular directories. See code below as an example:
coexisting-angular-microfrontends/.travis.yml
Lines 12 to 15 in 925dd8e
from coexisting-angular-microfrontends.
HI @joeldenning ,
Above worked for me, Thanks.
I've another issue which is as below.
I've added AngularJS Repo to this and provided extra route AngularJS for thisrepo.
i ran http-server in Angular repo then added http://localhost:8080/es5-app.js to import override, now when i access Angular JS repo route it gives CORS issue.
from coexisting-angular-microfrontends.
http-server --cors
from coexisting-angular-microfrontends.
https://www.npmjs.com/package/http-server#available-options
from coexisting-angular-microfrontends.
Hi @joeldenning
I've tried following.
- Ran
http-server --cors
inside AngularJS Repo - Ran
http-server --cors
inside both AngularJS Repo and this
Still it gives Error, :Access to script at 'http://localhost:8080/es5-app.js' from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Another issue:
I used below code to register through System JS
`System.register('angjs',[], function(_export) {
return {
execute: function() {
_export(singleSpaAngularjs.default({
angular: angular,
mainAngularModule: 'main-module',
uiRouter: true,
preserveGlobal: false,
template: '',
}))
}
}
})`
I got error with 37 as code, which says valid unmount not exist.
Please help!!
Thank you
from coexisting-angular-microfrontends.
@joeldenning ,
Worked for me.
Thanks
from coexisting-angular-microfrontends.
Related Issues (20)
- Upgrade an example with Angular 13. HOT 1
- Use IDE Debugger HOT 1
- how can I integrate a new angular application in another angular in a specific location?
- Import an utility module into microfrontend Angular
- Pending depdendencies pull requests
- Upgrade to SystemJS 6
- single spa won't display two apps at the same time HOT 5
- Styles overlapping and not able to unmount while switching from one app to another HOT 1
- Can we have Proxy HOT 5
- App.component not rendered HOT 2
- app1 does not load HOT 1
- Issue with $localize() after upgrading to angular 9 HOT 2
- Navbar died in status SKIP_BECAUSE_BROKEN HOT 4
- Nested (Child) Routes in Angular HOT 1
- After building , navigating to "app1" gives 404 HOT 3
- set live load to true not working
- seems not work... HOT 1
- Current status of support HOT 3
- live reload HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coexisting-angular-microfrontends.