I'm running a meteor project using angular as the front end and I can't seem to figure out how to get @ng-bootstrap/ng-bootstrap to import into my project correctly. Here is my setup...
Meteor Version: 1.6, Angular Version: 5.1.3, @ng-bootstrap/bootstrap: 1.0.0-beta.9, Bootstrap: 4.0.0 beta 3 (CSS through CDN)
client/app/app.module.ts: (cut down version)
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { AppComponent} from './app-component';
@NgModule({
imports: [OtherModules, NgbModule.forRoot()],
declarations: [AppComponent],
bootstrap: [AppComponent]
...
client/main.ts:
import '@ng-bootstrap/ng-bootstrap';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { Meteor } from 'meteor/meteor';
import { AppModule } from './app/app.module';
Meteor.startup(() => {
platformBrowserDynamic().bootstrapModule(AppModule);
});
I can't figure out why the module fails to import. I'm sure it's a simple problem that I just can't figure out. Thank you for your help!
The Full Error:
Can't resolve all parameters for NgbAlert: (?).
at syntaxError (modules.js?
hash=677f7440cc3c0fd0f024fe4055f104c52a9d1865:49950)
at CompileMetadataResolver._getDependenciesMetadata (modules.js?
hash=677f7440cc3c0fd0f024fe4055f104c52a9d1865:65156)
at CompileMetadataResolver._getTypeMetadata (modules.js?
hash=677f7440cc3c0fd0f024fe4055f104c52a9d1865:64991)
at CompileMetadataResolver.getNonNormalizedDirectiveMetadata (modules.js?
hash=677f7440cc3c0fd0f024fe4055f104c52a9d1865:64477)
at CompileMetadataResolver._getEntryComponentMetadata (modules.js?
hash=677f7440cc3c0fd0f024fe4055f104c52a9d1865:65304)
at modules.js?hash=677f7440cc3c0fd0f024fe4055f104c52a9d1865:64774
at Array.map (<anonymous>)
at CompileMetadataResolver.getNgModuleMetadata (modules.js?
hash=677f7440cc3c0fd0f024fe4055f104c52a9d1865:64774)
at CompileMetadataResolver.getNgModuleSummary (modules.js?
hash=677f7440cc3c0fd0f024fe4055f104c52a9d1865:64589)
at modules.js?hash=677f7440cc3c0fd0f024fe4055f104c52a9d1865:64687
I dodn't see how you are including the
NgbAlert
entity itself in your code... Does it look like –? Full example could be obtained here. Each ng-bootstrap entity you are going to use in your App needs to be included in your
@NgModule
"declarations". If this doesn't help, you need to update your post and show the exact code that produces your error.Update. Per official angular-meteor tutorial:
So, in addition to
NgModule
changes I put above, theng-bootstrap
package needs to be installed via npm: