Questions tagged [angular2-modules]

132 questions
1
vote
2 answers

Angular 2 Module Imports

I have my main module like this, where I import the basic Libraries : import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { MaterialModule } from '@angular/material'; import { FormsModule }…
StevieB
  • 6,263
  • 38
  • 108
  • 193
1
vote
2 answers

Import modules in the AppModule for separation of concerns in Angular2

Templates like from the ASP.NET Core JavaScript services came with a single module called AppModule. Since my application is divided into two logical areas, It seems a good idea to use two modules (AreaA, AreaB) for them. My idea was to import both…
Lion
  • 16,606
  • 23
  • 86
  • 148
1
vote
0 answers

Angular 2 Possible to Lazy Load a module while sending a parameter?

I am trying to lazy load a module while also sending along a parameter. { path: 'venuedetail', loadChildren: () => System.import('../containers/venue-detail/venue-detail.module').then((file: any) => { return file.default; …
David Aguirre
  • 1,382
  • 4
  • 15
  • 29
1
vote
1 answer

Angular2 Module with private nested DI Context

I am aware that Angular2 default DI Context strategy is to enrich an application-wide Dependency Injection Context. But I would like some Injectables to not be globally available. Here is a concrete example of what I am trying to achieve. There is…
Linvi
  • 2,077
  • 1
  • 14
  • 28
1
vote
2 answers

Angular - where to provide services?

If I want to isolate service in one module, I should create one root component for module, and use providers on this component (as said docs). If I use providers on the module, service become application level. So, it is way to provide…
Pavel
  • 2,602
  • 1
  • 27
  • 34
1
vote
1 answer

Use case for private components

I'm trying to come up with a simple use case for private components and here it it. Suppose I have the module HelloWorldAppModule with one public and one private component: @Component({ selector: 'hello-world', template: `
Max Koretskyi
  • 101,079
  • 60
  • 333
  • 488
1
vote
0 answers

Angular2 trying to import Orizens Infinite scroll, getting error TS2307 cannot find '@angular/core'

I have installed angular 2 using the cookbook from angular2's official website, but i a facing a problem when i try to import external modules. I have different npm packages, but with them all i get the error in the title: cannot find module…
Code_Viking
  • 618
  • 1
  • 8
  • 26
1
vote
1 answer

Angular 2 Unhandled Promise rejection: Template parse errors: 'app-main' is not a known element:

I have two separate modules app.module.ts and core.module.ts for loading two selectors app and app-main. The folder structure is like below: |main.ts |-App | |-app.module.ts | |-Components | |-app.component.ts | |-Core | |-core.module.ts | …
PaladiN
  • 4,625
  • 8
  • 41
  • 66
1
vote
1 answer

Can't share ng2-ckeditor between components. SharedModule

I'm trying to add ng2-ckeditor to test project. For this i added following line to systemjs.config.js 'ng2-ckeditor': 'npm:ng2-ckeditor/lib/CKEditor.js' shared.module.ts import { NgModule } from "@angular/core"; import {…
unsafePtr
  • 1,591
  • 2
  • 17
  • 27
1
vote
0 answers

Angular 2 Starter Webpack looses @NgModule Decorator during bundling

Hi I've written an angular 2 sdk to facilitate access to our backend service. Github Now I'm testing it on various popular templates and something strange happens with angular2-webpack-starter's template during bundling. it "looses" or doesn't…
Han Che
  • 8,239
  • 19
  • 70
  • 116
0
votes
0 answers

Import Angular Directive Globally

I'm trying to find out if there's a way to define .forRoot() in the module for one of my Directives that we use throughout the entire app. I'd like to be able to import that module in my app.module.ts once, so I can set some defaults for the entire…
Eric R
  • 673
  • 2
  • 9
  • 15
0
votes
1 answer

Angular 7+ Modularized Frontend

I would like to create a modularized frontend application, each module must be released independently. My problem is that I can create angular modules for each frontend module, but I have to build all modules together to make a release. I want to…
Dániel Kis
  • 2,341
  • 5
  • 28
  • 51
0
votes
0 answers

Running an angular module from one app into another app. Is that possible?

I have two web apps developed in angular 2. They share few common sets of functionality i.e. of Reward Gallery. That has been developed in one web app. I want the same functionality to be implemented in another app. So, is there a way to reuse that…
Deepak Terse
  • 652
  • 8
  • 30
0
votes
0 answers

(Angular 2+) Loading modules from outside the main.ts directory throws "Please add @NgModule annotation" error

I'm having an issue with loading a module that lives outside the node_modules directory. This directory structure works: + node_modules + Resources +--- app +------- main.ts +------- components +------- modules +----------- b.module.ts +-----------…
riyuyu
  • 167
  • 2
  • 8
0
votes
1 answer

Not able to include header component in user module build upon lazy load concept

Tried with these approachesI have created a component called header which includes the navigation. User is a module which includes a user-list and user-details component which is implemented by the lazy load technique. Along with user, i have…
1 2 3
8 9