New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting 403 when loading the component #8
Comments
Hey @dpdragnev, can you give me a little info on your setup? As in what are you using to build your app like webpack, angular-cli, etc? The reason I ask is because this may be a issue with your setup. If you can give me some more info that would help me narrow down the issue. |
I suspect that you are right, but I cannot figure out what I am missing. Index.html: just the head <head>
<title>App</title>
<base href="/">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<link href="~/Styles/site.css" rel="stylesheet" />
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="systemjs.config.js"></script>
<script>
System.import('main.js').catch(function(err){ console.error(err); });
</script>
</head> package.json:
system.config.js: /**
* System configuration for Angular samples
* Adjust as necessary for your application needs.
*/
(function (global) {
System.config({
baseURL: '.',
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things
map: {
// our app is within the app folder
app: 'app',
// angular bundles
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
// other libraries
'rxjs': 'npm:rxjs',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
'ng-block-ui': 'npm:ng-block-ui'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
app: {
defaultExtension: 'js'
},
rxjs: {
defaultExtension: 'js'
}
}
});
})(this); App.Module: import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BlockUIModule } from 'ng-block-ui';
import { AppComponent } from './components/app.component/app.component';
@NgModule({
imports: [
BrowserModule,
],
declarations: [
AppComponent
],
providers: [],
entryComponents: [],
bootstrap: [AppComponent]
})
export class AppModule { } Thank you for your help. |
sorry, I am not sure why the formatting is so messed up. Kind of hard to read. Let me know if you want me to send you the whole files. |
@dpdragnev No problem, I fixed the formatting for you in your comment. With code blocks you normally need to add ``` instead of ` to get it to format nicely. Thanks for the extra info. Looks like you are using systemjs which I currently don't have support for but I have been meaning to look into. Give me a few minutes and I will try to put together a PR with something that should work for you. |
task(lib): Added systemjs support (#8)
Thanks @kuuurt13 . I really appreciate your quick responses and help. |
@dpdragnev, I just merged #9 which should add systemjs support. I also published a new version to npm Updates:
Give this a shot and let me know if it works. Let me know if you have any questions. /**
* System configuration for Angular samples
* Adjust as necessary for your application needs.
*/
(function (global) {
System.config({
baseURL: '.',
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things
map: {
// our app is within the app folder
app: 'app',
// angular bundles
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
// other libraries
'rxjs': 'npm:rxjs',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
'ng-block-ui': 'npm:ng-block-ui/bundles/umd' // Point to the umd bundle
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
app: {
defaultExtension: 'js'
},
rxjs: {
defaultExtension: 'js'
},
'ng-block-ui': { main: 'index.js', defaultExtension: 'js' } // Resolve index.js
}
});
})(this); |
Awesome. Thank you so much. I will get this done in the morning and will report back. |
@kuuurt13 After following your instructions, everything worked as expected. Thank you for your quick response. |
Hello,
Here is my main module:
`import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BlockUIModule } from 'ng-block-ui';
import { AppComponent } from './components/app.component/app.component';
@NgModule({
imports: [
BrowserModule,
BlockUIModule
],
declarations: [
AppComponent
],
providers: [],
entryComponents: [],
bootstrap: [AppComponent]
})
export class AppModule { }`
When I run the app, I am getting:
http://site-url/node_modules/ng-block-ui/ 403 (Forbidden)
I have never seen this before. Any idea what could be the problem.
Thank you.
The text was updated successfully, but these errors were encountered: