Questions tagged [ng-modules]

Angular NgModule is a class marked by the @NgModule decorator.

NgModules configure the injector and the compiler and help organize related things together.

An NgModule is a class marked by the @NgModule decorator. @NgModule takes a metadata object that describes how to compile a component's template and how to create an injector at runtime. It identifies the module's own components, directives, and pipes, making some of them public, through the exports property, so that external components can use them. @NgModule can also add service providers to the application dependency injectors.

Resources

218 questions
0
votes
1 answer

Can I have different bootstrapped entry points for the same Angular module on different pages?

I have a tool built in Angular that is loaded within another CMS so the whole site is not an Angular app and Angular is not handling routing. On one page is a sophisticated tool that allows users to add and update their data, on the other I want to…
glenatron
  • 11,018
  • 13
  • 64
  • 112
0
votes
1 answer

Easy way to import classes in app.module.ts

I have an Angular 8 project with a standard app.module.ts and I am using many components from Angular Material. Everytime I use a new componenttype, I have to add it in the app.module.ts twice. [...] import…
Robin
  • 65
  • 1
  • 9
0
votes
1 answer

Angular AppConfig loaded from server, but needed in module setup

A lot of examples on the web around getting the configuration at APP_INITIALIZER in angular (now 8), here is one that sums it up: https://davembush.github.io/where-to-store-angular-configurations/ NgModule looks finally like this @NgModule({ //…
Ayyash
  • 4,257
  • 9
  • 39
  • 58
0
votes
2 answers

Angular 8: No component factory found for the component-even added in app.module.ts

I am trying to migrate the project from Angular 7 to Angular 8. However, getting the below error for the HeaderComponent after upgrading to Angular 8. zone.js:199 Uncaught Error: No component factory found for HeaderComp. Did you add it to…
Begumm
  • 69
  • 1
  • 2
  • 11
0
votes
0 answers

Angular child module not seeing classes from parent module

I have an angular recipe module. It declares and exports a recipe component. import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { RecipeComponent } from './recipe/recipe.component'; @NgModule({ …
Creature
  • 994
  • 1
  • 12
  • 27
0
votes
2 answers

How to fix Error: Unexpected value 'DataTableModule' imported by the module 'DashboardModule'. Please add a @NgModule annotation

I converted Angular 4 project to Angular 7. ng serve commands works but after login in an application, it gives error in console "Unexpected value 'DataTableModule' imported by the module 'DashboadModule' . Please add a @NgModule annotation."…
SSD
  • 1,041
  • 3
  • 19
  • 39
0
votes
0 answers

Angular Universal error before running the app

There are usual cases that cause some errors like using localStorage or window object. But these errors happen only when you open the browser and go throw the localhost:8080 and more specifically, you go to a specific route that you use those…
Vahid Najafi
  • 4,654
  • 11
  • 43
  • 88
0
votes
1 answer

Angular: How to use external module in lazy loaded routes

I install this module for my Angular project by ng add command. It imports the module in the app.module file. Also, I use lazy loading modules and routes in my project. I need this external module in one of my routes. I don't want to import it in…
Vahid Najafi
  • 4,654
  • 11
  • 43
  • 88
0
votes
0 answers

ERROR: No NgModule metadata found for 'undefined'

I have transpiled one angular module. Or 2nd case i have one angular module JS file to load into another Angular app using lazy loading. But got this error No NgModule metadata found for 'undefined'. Tried multiple solutions of reinstalling…
pranav-dev
  • 68
  • 1
0
votes
1 answer

Load module components dynamically Angular2

Basically there is a module.ts in every created module of the app for example: ng generate module newModuleName then the module is created with the newModuleName.module.ts file In the file, there is @NgModule with a declarations element. So I want…
Sergio Mendez
  • 1,311
  • 8
  • 33
  • 56
0
votes
0 answers

Angular LazyLoad module calling strange component

With lazy loading enabled in my Angular 7 app when I route to a child component I'm getting errors about MainComponent not being in any module. In app.module.ts the MainComponent is the one that loads when the app starts up. I'm seeing that…
Gargoyle
  • 9,590
  • 16
  • 80
  • 145
0
votes
1 answer

(Angular) Should I have my http services in core folder (as singleton) or in lazy loaded modules itself?

(Angular) Should I have my http services in core folder (as singleton) or in lazy loaded modules itself? Which approach is better?
bazera
  • 119
  • 1
  • 1
  • 9
0
votes
1 answer

TypeError: Cannot read property 'bookIsbn' of undefined when used ngModel with anular materials

I went through all the related issues, but can not find any proper answer. I am getting an error when using the [(ngModel)] with the angular material in forms data binding. add-book.component.html Create Book …</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/angularjs-directive" class="post-tag grid--cell" title="show questions tagged 'angularjs-directive'" rel="tag">angularjs-directive</a> <a href="../../questions/tagged/angular-material" class="post-tag grid--cell" title="show questions tagged 'angular-material'" rel="tag">angular-material</a> <a href="../../questions/tagged/ng-modules" class="post-tag grid--cell" title="show questions tagged 'ng-modules'" rel="tag">ng-modules</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Nov 23 '18 at 16:25">asked Nov 23 '18 at 16:25</time> <a href="../../users/9149503/mohamed-sajjadh" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/9149503.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Mohamed Sajjadh" /> </a> <div class="s-user-card--info"> <a href="../../users/9149503/mohamed-sajjadh" class="s-user-card--link">Mohamed Sajjadh</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">139</li> <li class="s-award-bling s-award-bling__silver" title="2 silver badges">2</li> <li class="s-award-bling s-award-bling__bronze" title="11 bronze badges">11</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-53364679"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/53364679/passing-parameter-to-child-or-peer-component-from-appcomponent-in-angular2" class="question-hyperlink">Passing parameter to child or peer component from AppComponent in Angular2</a></h3> <div class="excerpt">I have an application in NativeScript TypeScript on Angular2 consisting of the AppComponent and a LoginComponent as created through drag and drop by the Playground web application for NativeScript. I am wanting to pass the applicationName variable…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/angular" class="post-tag grid--cell" title="show questions tagged 'angular'" rel="tag">angular</a> <a href="../../questions/tagged/nativescript" class="post-tag grid--cell" title="show questions tagged 'nativescript'" rel="tag">nativescript</a> <a href="../../questions/tagged/angular2-nativescript" class="post-tag grid--cell" title="show questions tagged 'angular2-nativescript'" rel="tag">angular2-nativescript</a> <a href="../../questions/tagged/ng-modules" class="post-tag grid--cell" title="show questions tagged 'ng-modules'" rel="tag">ng-modules</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Nov 18 '18 at 19:30">asked Nov 18 '18 at 19:30</time> <a href="../../users/2178363/jason-k" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/2178363.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Jason K." /> </a> <div class="s-user-card--info"> <a href="../../users/2178363/jason-k" class="s-user-card--link">Jason K.</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">790</li> <li class="s-award-bling s-award-bling__gold" title="1 gold badge">1</li> <li class="s-award-bling s-award-bling__silver" title="14 silver badge">14</li> <li class="s-award-bling s-award-bling__bronze" title="22 bronze badge">22</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-53148838"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>2</strong> answers </div> </div> </div> <div class="summary"> <h3><a href="../../questions/53148838/angular-project-break-into-modules" class="question-hyperlink">Angular project break into modules</a></h3> <div class="excerpt">I'm building a web application in angular. In my application there are two major roles who can use the system. 1. Teacher 2. Student Both have different functions and different user interfaces. Should i break my angular application into two…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/angular" class="post-tag grid--cell" title="show questions tagged 'angular'" rel="tag">angular</a> <a href="../../questions/tagged/module" class="post-tag grid--cell" title="show questions tagged 'module'" rel="tag">module</a> <a href="../../questions/tagged/ng-modules" class="post-tag grid--cell" title="show questions tagged 'ng-modules'" rel="tag">ng-modules</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Nov 05 '18 at 05:32">asked Nov 05 '18 at 05:32</time> <a href="../../users/5837376/buddhika-chathuranga" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/5837376.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Buddhika Chathuranga" /> </a> <div class="s-user-card--info"> <a href="../../users/5837376/buddhika-chathuranga" class="s-user-card--link">Buddhika Chathuranga</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">1,334</li> <li class="s-award-bling s-award-bling__gold" title="2 gold badges">2</li> <li class="s-award-bling s-award-bling__silver" title="13 silver badges">13</li> <li class="s-award-bling s-award-bling__bronze" title="22 bronze badges">22</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="s-pagination pager fr"> <a class="s-pagination--item" href="../../questions/tagged/ng-modules_page=11" rel="prev" title="Go to page 11">Prev </a> <a class="s-pagination--item" href="../../questions/tagged/ng-modules_page=1" rel="" title="Go to page 1">1</a> <a class="s-pagination--item" href="../../questions/tagged/ng-modules_page=2" rel="" title="Go to page 2">2</a> <a class="s-pagination--item" href="../../questions/tagged/ng-modules_page=3" rel="" title="Go to page 3">3</a> <div class="s-pagination--item s-pagination--item__clear">…</div> <a class="s-pagination--item" href="../../questions/tagged/ng-modules_page=14" rel="" title="Go to page 14">14</a> <a class="s-pagination--item" href="../../questions/tagged/ng-modules_page=15" rel="" title="Go to page 15">15</a> <a class="s-pagination--item" href="../../questions/tagged/ng-modules_page=13" rel="next" title="Go to page 13"> Next</a> </div> </div> </div> </div> </div> <script src="../../static/js/stack-icons.js"></script> <script src="../../static/js/fromnow.js"></script> </body> </html>