Questions tagged [angular2-modules]
132 questions
0
votes
2 answers
How to load new route in main route
Currently I'm new to Angular. I was learning routing topic but seems to stuck at a point where I want to load new route in main route. My app.module looks like
import { NgModule } from '@angular/core';
import { BrowserModule } from…
![](../../users/profiles/7926406.webp)
Mohammad Hani
- 183
- 3
- 11
0
votes
2 answers
unable to export MaterialModule from shared.module.ts on Build time
It's working on ng serve but giving error as follow
ERROR in Unexpected value 'MaterialModule in E:/Code/employee-web/node_modules/@angular/material/typings/index.d.ts'
impor
ted by the module 'SharedModule in…
![](../../users/profiles/6160845.webp)
Er Sushil
- 881
- 1
- 8
- 17
0
votes
1 answer
How to customize code of existing installed module
I am using an Angular2 module which provides me with a custom tag input field (angular2-tag-input module), but I would need some feature in the input the module doesn't provide.
As this feature is quite specific to my project, it wouldn't fit as a…
![](../../users/profiles/6565843.webp)
Vinny
- 33
- 5
0
votes
0 answers
component gets load before destroying another in angular 2 router
I am facing issue in Angular 2 router view rendering. any help would be appreciated.
Current Scenario:
While navigating from one view to another, Angular 2 router loads the new view on top of the previous one without destroying the previous…
![](../../users/profiles/6333527.webp)
waleed ali
- 1,049
- 9
- 19
0
votes
1 answer
Approaches to services and components in Angular modules provided by libraries
I thought I understood Angular modules, but am having trouble figuring out the best approach for structuring modules involving services and components to be provided by a library.
The library implements a NotificationsComponent, which depends on a…
user663031
0
votes
1 answer
how to share service between two modules in angular2
in my application, I have two different module (@NgModule) running independently and now I want they should communicate to each other and share data.the two modules are lazy loaded.how to reflect the service changes in module1 to module2
0
votes
1 answer
lazy loading nested module and routing
I got problem with routing inside lazy loaded modules.
Here is my "root" routes:
const routes: Routes = [
{path: '', redirectTo: 'admin', pathMatch: 'full' },
{path: 'admin', loadChildren: 'app/admin.module#AdminModule'}
];
@NgModule({
…
![](../../users/profiles/2849613.webp)
Maciej Treder
- 9,856
- 4
- 40
- 67
0
votes
1 answer
Good or bad to provide services per component angular 4?
Actually, I have two questions about angular 4 best practice.
I have a service named RemoteService, which is responsible for XHR calls. I want to catch component instance, which is using that service, in RemoteService. So I guess, it is better to…
![](../../users/profiles/5087916.webp)
dvl Batdelger
- 111
- 9
0
votes
1 answer
Angular2 Manage large number of components
I am working on Angular2. As we know we need to configure all providers, components, services in the main module. It may be the case where we have a large number of components and manually configuring it. For instance, consider the following…
![](../../users/profiles/1302565.webp)
notnotundefined
- 2,772
- 1
- 26
- 37
0
votes
1 answer
Angular2 multiple components different imports
I am pretty new to Angular2, and i'm trying to modify a template.
Basically, by default, all views are nested in a template with Header, Footer and TopNavbarModule.
I am trying to avoid importing these modules for some view components.
So I have…
![](../../users/profiles/4894552.webp)
Adrien Chapelet
- 252
- 3
- 19
0
votes
1 answer
Angular2 Google sign
Hi I'm trying Angular2 with Type Script to add a login/logout to/from google by their guide
In Index.html
In LoginComponent.ts
declare const gapi: any;
ngAfterViewInit() {
…
![](../../users/profiles/2270534.webp)
Loga Nathan
- 93
- 1
- 2
- 14
0
votes
1 answer
building and publishing an angular2 module
I've written a remote logger for angular2 which works fine. I'd now like to publish it as its own npm library and struggle with making it available. I've oriented myself at the setup of the ngx-translate module.
The general setup of the logger I am…
![](../../users/profiles/898999.webp)
Lars
- 5,547
- 3
- 21
- 52
0
votes
2 answers
Angular2 shared/core module in lazy
I have 4 feature modules which will be loaded lazy.
Have multiple popups components, which is need for the feature modules.
Currently i have created a shared module which will export these component and each feature module will import this shared…
![](../../users/profiles/3118041.webp)
user3118041
- 113
- 5
0
votes
1 answer
Angular2 nested children routing does not find the route match
I have a menu with some buttons, when the user clicks on the menu, the page is directed to another page with list of buttons that have a link to another page.
Therefore my routing looks like this:
const routes: Routes = [
{
path: '',
…
![](../../users/profiles/7578519.webp)
DingDong
- 369
- 2
- 8
- 21
0
votes
3 answers
Angular2 import and declare global service from submodule
I have an interesting question. I have 2 modules. app.module.ts (AppModule) and listings.module.ts (ListingsModule). ListingsModule has a service, let us call it service A. A needs to be a singleton global service, meaning that all of the other…
![](../../users/profiles/1702592.webp)
Karl Johan Vallner
- 3,051
- 2
- 28
- 40