From 449952b1bb65ab9b6ddca5fa887e91f388b03d52 Mon Sep 17 00:00:00 2001 From: Somo Makombo Date: Sun, 15 Jan 2017 23:18:59 -0600 Subject: [PATCH 1/2] Library Modules should not import BrowserModule anywhere Caused 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.` After trying on lazy loaded app, that had `Ng2BootstrapModule.forRoot()` imported in root App Module. --- src/sortable/sortable.module.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sortable/sortable.module.ts b/src/sortable/sortable.module.ts index 04bc62db07..acdd8f4184 100644 --- a/src/sortable/sortable.module.ts +++ b/src/sortable/sortable.module.ts @@ -1,12 +1,12 @@ import { NgModule, ModuleWithProviders } from '@angular/core'; -import { BrowserModule } from '@angular/platform-browser'; +import {CommonModule} from "@angular/common"; import { SortableComponent } from './sortable.component'; import { DraggableItemService } from './draggable-item.service'; @NgModule({ declarations: [SortableComponent], - imports: [BrowserModule], + imports: [CommonModule], exports: [SortableComponent] }) export class SortableModule { From fbd402aa74ad829ff72e51469791a9640d21a718 Mon Sep 17 00:00:00 2001 From: Somo Makombo Date: Sun, 15 Jan 2017 23:35:26 -0600 Subject: [PATCH 2/2] changed code styling to be consistent with the rest Hopefully it will pass CI tests now! --- src/sortable/sortable.module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sortable/sortable.module.ts b/src/sortable/sortable.module.ts index acdd8f4184..8681008507 100644 --- a/src/sortable/sortable.module.ts +++ b/src/sortable/sortable.module.ts @@ -1,5 +1,5 @@ import { NgModule, ModuleWithProviders } from '@angular/core'; -import {CommonModule} from "@angular/common"; +import { CommonModule } from '@angular/common'; import { SortableComponent } from './sortable.component'; import { DraggableItemService } from './draggable-item.service';