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…
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…
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…
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…
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({ …
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…
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…
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…
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() { …
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…
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…
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: '', …
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…
Karl Johan Vallner
  • 3,051
  • 2
  • 28
  • 40
1 2 3
8
9