angular2-modules

Angular 2 Routing Error with ModuleWithProviders

怎甘沉沦 提交于 2019-12-22 10:36:39
问题 I'm new in Angular 2 I need help on the routing part. I'm using http://jasonwatmore.com/post/2016/09/29/angular-2-user-registration-and-login-example-tutorial I got an error Exported variable 'routing' has or is using name 'ModuleWithProviders' from external module "/home/frank/angular/node_modules/@angular/core/src/metadata/ng_module" but cannot be named. Here is my code import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { FormsModule

Multiple modules in Angular 2

拜拜、爱过 提交于 2019-12-21 04:52:42
问题 I have an Angular 2 app (RC7) which started as a single component but is quickly becoming used throughout the project in various different (and sometimes completely unrelated) ways. As a result of this, a single NgModule bootstrapping all the components seems like a terrible idea with a huge amount of bloat. I am struggling to find a way to have multiple modules (Module A would contain Component A, Module B would have Component B, etc) and still allow the bootstrapping of multiple A2

Lazy Loading BrowserModule has already been loaded

﹥>﹥吖頭↗ 提交于 2019-12-18 14:08:12
问题 I am trying to implement lazy loading but getting error as following ** ERROR Error: Uncaught (in promise): Error: BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead. ** Need Help on this. Here are my Modules Shared MOdule @NgModule({ declarations: [TimePipe], providers: [ EmsEmployeeService, EmsDesignationService, EmsOrganizationService, EmsAuthService, AmsEmployeeService,

Angular2 module has no exported member

让人想犯罪 __ 提交于 2019-12-18 12:04:15
问题 For a website with authentication in Angular2, I want to use a component of the authentication submodule in the main app component. However, I keep getting the following error: app/app.component.ts(3,10): error TS2305: Module '"<dir>/app/auth/auth.module"' has no exported member 'SigninComponent'. even after exporting SigninComponent. The project folder structure is as shown below: app/auth/auth.module.ts: import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common

Angular2 router: how to correctly load children modules with their own routing rules

别等时光非礼了梦想. 提交于 2019-12-17 18:01:19
问题 here is my Angular2 app structure: Here is part of my code. The following is the main module of the Angular2 app, that imports its routing rules and a child module ( EdgeModule ) and uses some components related to some pages. app.module.ts @NgModule({ declarations: [ AppComponent, PageNotFoundComponent, LoginComponent ], imports: [ ... appRouting, EdgeModule ], providers: [ appRoutingProviders, LoginService ], bootstrap: [AppComponent] }) export class AppModule { } Here is the routing rules

unable to export MaterialModule from shared.module.ts on Build time

北城余情 提交于 2019-12-13 07:32:54
问题 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 E:/Code/employee-web/src/app/shared/shared.module.ts'. Please add a @NgModule annotatio n. ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'E:\Code\employee-web\src' resolve './$$_gendir/app/app.module.ngfactory' in 'E:\Code

How to import/use lazy load module on another ng-module

时光怂恿深爱的人放手 提交于 2019-12-12 11:43:02
问题 I have two ng-module Dash Board Repeat order list I had loaded Repeat order through the lazy load. Now I want to use Repeat order, inside dashboard as html <app-repeatorderlist></app-repeatorderlist> If I am doing same it is throwing me an error 'app-repeatorderlist' is not a known element: 1. If 'app-repeatorderlist' is an Angular component, then verify that it is part of this module. 2. If 'app-repeatorderlist' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas'

Using vanilla js code in Angular 2 (angular-cli)

∥☆過路亽.° 提交于 2019-12-11 06:53:54
问题 I am trying to implement the Vanilla Tilt JS plugin in my project, but I can't even seem to find a way of using vanilla js imports in my project. So far, I have tried using it as a directive, just like you would use a jQuery plugin by using ElementRef , Input etc. from @angular/core . I have included the script in my .angular-cli.json file under scripts: directly from the npm package that I have installed for Vanilla Tilt JS. And I was thinking about using it as a directive, since it has its

Import modules in the AppModule for separation of concerns in Angular2

十年热恋 提交于 2019-12-11 06:39:08
问题 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 in AppModule , including shared ressources like Pipes (which can cause trouble here). So for testing purpose, I created a Module called ModuleA import { HomeComponent } from './home/home.component'; import { NgModule } from '@angular/core'; import

what is the benefit of using multiple modules in Angular2 apart from simplicity in designing? [closed]

天大地大妈咪最大 提交于 2019-12-11 01:34:02
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago . Will it help to reduce the loading time?(like by loading only current module to client's device? ) what I understand is that... It will increase the number of request between server and client? It will increase the complexity of your code.(Since you need to take care of