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

192 questions
0
votes
0 answers

ionic/angular 2 receive a list of declared modules

Tell me please, how to receive a list all classes, which was declared in @NgModule. Which modules I have in @NgModule: @NgModule({ declarations: [MyApp, AuthPage, HomePage] }) And example of I want to receive: export class AppModule { …
Yegor
  • 968
  • 1
  • 9
  • 13
0
votes
1 answer

Get Elements, variables from other component through Double @NgModule Angular2

I'd like to get a value of variable element, _dataTable from component datatable.component.ts (from render() function) to create a new event for new button by element.on. Or create a new function inside this component. I've a problem how to get to…
DejwitK
  • 55
  • 9
0
votes
1 answer

Reusing the same NgModule with different config

I want to build a generic module that I can pass some config to customize it. For example, in the root module I want to have something like @NgModule({ imports: [ moduleFactory(config1), moduleFactory(config2), …
csbenjamin
  • 356
  • 2
  • 8
0
votes
2 answers

No NgModule metadata found for 'AppModule' in Angular4 i am not able to find the reason its showing in main.ts

Here is my package.json file , i have doubt on version of type script and angular cli , some results are also saying yarn issue . { "name": "suntistfrontend", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start":…
0
votes
0 answers

angular 2 - multiple but optional apps on one site

I have a scenario where I need multiple apps on one single page but they have to be optional. So I have 3 root-tags: , and but they will not always be all there, e.g. main-root could be missing on one page. So I created 3 NgModules: @NgModule({ …
Felix
  • 43
  • 5
0
votes
1 answer

Component of CustomModule ignores toplevel declaration in AppModule

After a long search on this pages, I am still lost. I have an AppModule and an ModalModule. AppModule is importing ModalModule AppModule declares LoaderComponent with this decorator attributes: selector: 'my-loader', template:…
weihs.th
  • 49
  • 5
0
votes
1 answer

LazyLoading and config angular NgModule

I have a module 'DevicePreview' that have some routes and can be displayed both from root and from inside another module 'Content'. When called from root DevicePreview has routes /a, /b and /c available, when called from Content it has /a, /b and…
subarroca
  • 761
  • 6
  • 20
0
votes
1 answer

Using component encapsulated in a module from other module in angular 4

I am developing an angular 4 app and I have two modules, the first module encapsulate some features that I need to use in others modules. For example I have the first module called SRModule I have imported SrCrComponent component: import { NgModule…
xzegga
  • 2,648
  • 2
  • 20
  • 42
0
votes
1 answer

Component directives and NgModule

I am trying to split a component I have in three. So I created a new component, template, etc... Now I need to include the children components into the main component in order to make children selectors work. I learned that component directives is…
fred00
  • 521
  • 2
  • 6
  • 22
0
votes
0 answers

Updation of a shared object that is created inside factory method of a module is not updating in another module in Angular JS

Hello I am a beginner in Angular JS and now I am stuck into something. I have made two modules Menu and Canvas Now I have declared a object inside the factory method of Menu module to make it available from Canvas module. My code is as follow; var…
KOUSIK MANDAL
  • 1,781
  • 17
  • 36
0
votes
0 answers

Can't bind to 'valueToPass' since it isn't a known property of 'app-departments'

I have an issue with Angular2 project. I have two components, Departments component and Full-Layout component. I'm trying to pass data from Full-Layout component to Departments by using Input(). full-layout.component.ts import {Component, OnInit}…
0
votes
1 answer

Core Module's Directive Confusion of Service Usage

I've got a core module named CoreModule, it contains a service named MapManagerService, directive named FlyToDirective which uses the MapManagerService, and a component named ElementComponent which uses the the flyTo. My AppModule imports the…
Kesem David
  • 1,879
  • 3
  • 19
  • 44
0
votes
1 answer

Angular 2 : How to reuse common code for other apps to use?

Need suggestions on how to reuse common code across angular apps. We started developing an app with angular2 for some specific needs but at a later point realized that more apps will follow and try to reuse ALL or ONE of the common services and…
0
votes
1 answer

Which criteria decides how to map modules to components for Angular2?

How modules are distributed on components. and what are the advantages of this new concept over simple folder organisation ? Options: One module per component ? One module per page. Other ...
user2080105
  • 1,303
  • 3
  • 15
  • 25
0
votes
1 answer

ionic2 // Can't use my module in a page component

I'm upgrading my application from the beta.11 to the RC3. But I have a problem with a component I used in the beta.11 version. Basically, I created a modular component "MyMessage", which is a angular2 component (and not a NgModule). I use this…
Julian Le Calvez
  • 423
  • 6
  • 26
1 2 3
12
13