Questions tagged [angular-module]

You can think of an Angular/AngularJS module as a container for the different parts of your app – controllers, services, filters, directives, etc.

Most applications have a main method that instantiates and wires together the different parts of the application.

Angular apps don't have a main method. Instead modules declaratively specify how an application should be bootstrapped. There are several advantages to this approach:

  • The declarative process is easier to understand.
  • You can package code as reusable modules.
  • The modules can be loaded in any order (or even in parallel) because modules delay execution.
  • Unit tests only have load relevant modules, which keeps them fast.
  • End-to-end tests can use modules to override configuration.

Full documentation on AngularJS modules.

555 questions
-1
votes
1 answer

Angular: How to share a component between different components in different modules and vice versa

How to share a component between different components in different modules share the components in the different modules with the shared component. I have four modules. Module A with component A, Module B with component B, Module C with component C,…
YulePale
  • 6,688
  • 16
  • 46
  • 95
-1
votes
3 answers

ng g module my-module only generates the module.ts file

ng g module my-module only generates the module.ts file. But I need all the files css, HTML, ts, spec, module.ts. How can I generate all of them at a time using cli?
-1
votes
1 answer

In Angular 8, how do I pass a component into another component's input and then use it imperatively in a router module

I have already looked at the following two threads that were about using a component passed in declaratively (1, 2, contentChildren, ng-content) in the template, I am asking how one could pass in a component and use it imperatively (in a routing…
-1
votes
1 answer

Error - AngularJS Uncaught TypeError:angular.service is not a function at taskService.js:2

I'm having these errors in angularJS, with well-imported libraries, I don't know what might be happening. Exactly these two: Uncaught TypeError: angular.service is not a function at taskService.js:2 taskFactory.js:2 Uncaught TypeError:…
userem
  • 1
  • 2
-1
votes
1 answer

Change the language of Angular datepicker (AngularDateTimePickerModule)

I'm using this date picker https://www.npmjs.com/package/angular2-datetimepicker, and I would like to know if there is any way in which I can change the naming of the weekdays "Mon/Tue/Wed/..." or the naming of months? There's a StackBlitz example…
DLO
  • 914
  • 1
  • 13
  • 30
-1
votes
1 answer

How to structure a module as to deploy separately

I had a request from my client to deploy a module alone to server. In my app I have multiple module. according to client requirement I need to keep all of modules as a separate application, so each of them can be deployed separately without other…
3gwebtrain
  • 14,640
  • 25
  • 121
  • 247
-1
votes
2 answers

Angular 2+ how to reference component in a peer MODULE

Angular 2 - 7: (Source below): I have SectionA Module with components a and b. A peer of SectionA is SectionB module with components ba and bb. The parent of BOTH SectionA and SectionB is called all-sections.module.ts. In app.module, I ONLY…
Yogi Bear
  • 943
  • 2
  • 16
  • 32
-1
votes
1 answer

How to use a custom Angular module in different projects

I want to create a common module which will contain components like login, sidebar etc and pipes, services, directives. @NgModule({ declarations: [ AppComponent, LoginComponent, SidebarComponent, InitialsPipe ], imports: [ …
Adrita Sharma
  • 21,581
  • 10
  • 69
  • 79
-1
votes
2 answers

Primeng don't import card component

I would use Primeng Card component In module.ts I call the module. import { CardModule } from 'primeng/card'; when compiling, angular don't find the module ERROR in /home/haddad/projects/arrr/arrrt/src/app/app.module.ts (9,28): Cannot find…
infodev
  • 4,673
  • 17
  • 65
  • 138
-1
votes
1 answer

Angular 'router-outlet' is not a known element '

It is duplicate question but since the issue is because of many reasons ,previous answers did not help me. I am trying to split existing project into modules and the problem is in Unibook component(and in employees,structures,students,orders) which…
-1
votes
1 answer

Angular2 - Provider and bootstrap of a root module

In the root module(app.module.ts), @NgModule({ declarations: [ AppComponent, HomeComponent, DirectoryComponent, FilterPipe, LoggingService ], imports: [ FormsModule, BrowserModule, HttpClientModule, routing …
overexchange
  • 15,768
  • 30
  • 152
  • 347
-1
votes
1 answer

Why does loading modules in index.html make them available in child states?

So, I am loading a bunch of .js files in my index.html with code like this... When i am in login.js, i can simply…
TkNeo
  • 415
  • 1
  • 7
  • 16
-2
votes
2 answers

Angular 7 - Getting Component from imported Module

I read all presented questions stack overflow showed me, none of which solved my issue. I'm new to Angular and I have a couple Modules and Components. I want a child module to import a component. Then have a parent module import the child module and…
-2
votes
1 answer

In which module should I declare Angular Directive?

I have a Directive: @Directive({ selector: '[ICheck]', }) export class ICheckDirective { @Input() ICheck: string; constructor(element: ElementRef) { var $element: any = $(element.nativeElement); $element.iCheck({ …
Mohamad Shiralizadeh
  • 8,329
  • 6
  • 58
  • 93
-4
votes
1 answer

how to fix routing and module problem in angular 6?

WARNING in Circular dependency detected :
1 2 3
36
37