Commit a2e18ef9 authored by Ed Carroll's avatar Ed Carroll
Browse files

feat: Added forRoot to all ngModules

Lazy loading support. Addresses #212
parent a88509d3
import { NgModule } from "@angular/core";
import { NgModule, Optional, SkipSelf, ModuleWithProviders } from "@angular/core";
import { CommonModule } from "@angular/common";
import { SuiLocalizationService } from "./services/localization.service";
const imports = [
CommonModule
];
@NgModule({
imports: [
...imports
],
providers: [
SuiLocalizationService
]
})
export class SuiLocalizationRootModule {}
@NgModule({
imports: [CommonModule],
providers: [SuiLocalizationService]
imports: [
...imports
]
})
export class SuiLocalizationModule {}
export class SuiLocalizationModule {
public static forRoot():ModuleWithProviders {
return {
ngModule: SuiLocalizationRootModule
};
}
}
import { NgModule } from "@angular/core";
import { NgModule, ModuleWithProviders } from "@angular/core";
import { CommonModule } from "@angular/common";
import { SuiTransitionModule } from "../../modules/transition";
import { SuiMessage } from "./components/message";
const imports = [
CommonModule
];
const declarations = [
SuiMessage
];
const exports = [
SuiMessage
];
@NgModule({
imports: [
CommonModule,
SuiTransitionModule
...imports,
SuiTransitionModule.forRoot()
],
declarations: [
SuiMessage
declarations,
exports
})
export class SuiMessageRootModule {}
@NgModule({
imports: [
...imports,
SuiTransitionModule
],
exports: [
SuiMessage
]
declarations,
exports
})
export class SuiMessageModule {}
export class SuiMessageModule {
public static forRoot():ModuleWithProviders {
return {
ngModule: SuiMessageRootModule
};
}
}
import { NgModule } from "@angular/core";
import { NgModule, ModuleWithProviders } from "@angular/core";
import { CommonModule } from "@angular/common";
import { SuiPagination } from "./components/pagination";
const imports = [
CommonModule
];
const declarations = [
SuiPagination
];
const exports = [
SuiPagination
];
@NgModule({
imports: [
...imports
],
declarations,
exports
})
export class SuiPaginationRootModule {}
@NgModule({
imports: [CommonModule],
exports: [SuiPagination],
declarations: [SuiPagination],
providers: []
imports: [
...imports
],
declarations,
exports
})
export class SuiPaginationModule { }
export class SuiPaginationModule {
public static forRoot():ModuleWithProviders {
return {
ngModule: SuiPaginationModule
};
}
}
import { NgModule } from "@angular/core";
import { NgModule, ModuleWithProviders } from "@angular/core";
import { CommonModule } from "@angular/common";
import { SuiComponentFactory } from "./services/component-factory.service";
const imports = [
CommonModule
];
const providers = [
SuiComponentFactory
];
@NgModule({
imports: [
...imports
],
providers
})
export class SuiUtilityRootModule {}
@NgModule({
imports: [CommonModule],
providers: [
SuiComponentFactory
]
imports: [
...imports
],
providers
})
export class SuiUtilityModule {}
export class SuiUtilityModule {
public static forRoot():ModuleWithProviders {
return {
ngModule: SuiUtilityModule
};
}
}
import { NgModule } from "@angular/core";
import { NgModule, ModuleWithProviders } from "@angular/core";
import { CommonModule } from "@angular/common";
import { SuiCollapseModule } from "../collapse";
import { SuiTransitionModule } from "../transition";
import { SuiAccordion } from "./components/accordion";
import { SuiAccordionPanel } from "./components/accordion-panel";
const imports = [
CommonModule
];
const declarations = [
SuiAccordion,
SuiAccordionPanel
];
const exports = [
SuiAccordion,
SuiAccordionPanel
];
@NgModule({
imports: [
...imports,
SuiCollapseModule.forRoot(),
SuiTransitionModule.forRoot()
],
declarations,
exports
})
export class SuiAccordionRootModule {}
@NgModule({
imports: [
CommonModule,
...imports,
SuiCollapseModule,
SuiTransitionModule
],
declarations: [
SuiAccordion,
SuiAccordionPanel
],
exports: [
SuiAccordion,
SuiAccordionPanel
],
providers: []
declarations,
exports
})
export class SuiAccordionModule {}
export class SuiAccordionModule {
public static forRoot():ModuleWithProviders {
return {
ngModule: SuiAccordionRootModule
};
}
}
import { NgModule } from "@angular/core";
import { NgModule, ModuleWithProviders } from "@angular/core";
import { CommonModule } from "@angular/common";
import { FormsModule } from "@angular/forms";
import { SuiCheckbox, SuiCheckboxValueAccessor } from "./components/checkbox";
import { SuiRadio, SuiRadioValueAccessor } from "./components/radio";
import { SuiRadioManager } from "./directives/radio-manager";
const imports = [
CommonModule,
FormsModule
];
const declarations = [
SuiCheckbox,
SuiCheckboxValueAccessor,
SuiRadio,
SuiRadioValueAccessor,
SuiRadioManager
];
const exports = [
SuiCheckbox,
SuiCheckboxValueAccessor,
SuiRadio,
SuiRadioValueAccessor,
SuiRadioManager
];
@NgModule({
imports: [
CommonModule,
FormsModule
...imports
],
declarations: [
SuiCheckbox,
SuiCheckboxValueAccessor,
SuiRadio,
SuiRadioValueAccessor,
SuiRadioManager
declarations,
exports
})
export class SuiCheckboxRootModule {}
@NgModule({
imports: [
...imports
],
exports: [
SuiCheckbox,
SuiCheckboxValueAccessor,
SuiRadio,
SuiRadioValueAccessor,
SuiRadioManager
]
declarations,
exports
})
export class SuiCheckboxModule {}
export class SuiCheckboxModule {
public static forRoot():ModuleWithProviders {
return {
ngModule: SuiCheckboxRootModule
};
}
}
import { NgModule } from "@angular/core";
import { NgModule, ModuleWithProviders } from "@angular/core";
import { CommonModule } from "@angular/common";
import { SuiCollapse } from "./directives/collapse";
const imports = [
CommonModule
];
const declarations = [
SuiCollapse
];
const exports = [
SuiCollapse
];
@NgModule({
imports: [
CommonModule
...imports
],
declarations: [
SuiCollapse
declarations,
exports
})
export class SuiCollapseRootModule {}
@NgModule({
imports: [
...imports
],
exports: [
SuiCollapse
]
declarations,
exports
})
export class SuiCollapseModule {}
export class SuiCollapseModule {
public static forRoot():ModuleWithProviders {
return {
ngModule: SuiCollapseRootModule
};
}
}
import { NgModule } from "@angular/core";
import { NgModule, ModuleWithProviders } from "@angular/core";
import { CommonModule } from "@angular/common";
import { FormsModule } from "@angular/forms";
import { SuiPopupModule } from "../popup";
......@@ -17,37 +17,66 @@ import {
SuiDatepickerDirectiveValidator
} from "./directives/datepicker.directive";
const imports = [
CommonModule,
FormsModule
];
const declarations = [
SuiCalendarItem,
SuiCalendarYearView,
SuiCalendarMonthView,
SuiCalendarDateView,
SuiCalendarHourView,
SuiCalendarMinuteView,
SuiDatepicker,
SuiDatepickerDirective,
SuiDatepickerDirectiveValueAccessor,
SuiDatepickerDirectiveValidator,
SuiDatepickerInputDirective
];
const entryComponents = [
SuiDatepicker
];
const exports = [
SuiDatepickerDirective,
SuiDatepickerDirectiveValueAccessor,
SuiDatepickerDirectiveValidator,
SuiDatepickerInputDirective
];
@NgModule({
imports: [
CommonModule,
FormsModule,
...imports,
SuiPopupModule.forRoot(),
SuiLocalizationModule.forRoot(),
SuiUtilityModule.forRoot()
],
declarations,
entryComponents,
exports
})
export class SuiDatepickerRootModule {}
@NgModule({
imports: [
...imports,
SuiPopupModule,
SuiLocalizationModule,
SuiUtilityModule
],
declarations: [
SuiCalendarItem,
SuiCalendarYearView,
SuiCalendarMonthView,
SuiCalendarDateView,
SuiCalendarHourView,
SuiCalendarMinuteView,
SuiDatepicker,
SuiDatepickerDirective,
SuiDatepickerDirectiveValueAccessor,
SuiDatepickerDirectiveValidator,
SuiDatepickerInputDirective
],
exports: [
SuiDatepickerDirective,
SuiDatepickerDirectiveValueAccessor,
SuiDatepickerDirectiveValidator,
SuiDatepickerInputDirective
],
entryComponents: [
SuiDatepicker
]
declarations,
entryComponents,
exports
})
export class SuiDatepickerModule {}
export class SuiDatepickerModule {
public static forRoot():ModuleWithProviders {
return {
ngModule: SuiDatepickerRootModule
};
}
}
import { NgModule } from "@angular/core";
import { NgModule, ModuleWithProviders } from "@angular/core";
import { CommonModule } from "@angular/common";
import { SuiTransitionModule } from "../transition";
import { SuiDimmer } from "./components/dimmer";
const imports = [
CommonModule
];
const declarations = [
SuiDimmer
];
const exports = [
SuiDimmer
];
@NgModule({
imports: [
CommonModule,
SuiTransitionModule
...imports,
SuiTransitionModule.forRoot()
],
declarations: [
SuiDimmer
declarations,
exports
})
export class SuiDimmerRootModule {}
@NgModule({
imports: [
...imports,
SuiTransitionModule
],
exports: [
SuiDimmer
]
declarations,
exports
})
export class SuiDimmerModule {}
export class SuiDimmerModule {
public static forRoot():ModuleWithProviders {
return {
ngModule: SuiDimmerRootModule
};
}
}
import { NgModule } from "@angular/core";
import { NgModule, ModuleWithProviders } from "@angular/core";
import { CommonModule } from "@angular/common";
import { SuiTransitionModule } from "../transition";
import { SuiDropdown } from "./directives/dropdown";
import { SuiDropdownMenu, SuiDropdownMenuItem } from "./directives/dropdown-menu";
const imports = [
CommonModule
];
const declarations = [
SuiDropdown,
SuiDropdownMenu,
SuiDropdownMenuItem
];
const exports = [
SuiDropdown,
SuiDropdownMenu,
SuiDropdownMenuItem
];
@NgModule({
imports: [
CommonModule,
SuiTransitionModule
...imports,
SuiTransitionModule.forRoot()
],
declarations: [
SuiDropdown,
SuiDropdownMenu,
SuiDropdownMenuItem
declarations,
exports
})
export class SuiDropdownRootModule {}
@NgModule({
imports: [
...imports,
SuiTransitionModule
],
exports: [
SuiDropdown,
SuiDropdownMenu,
SuiDropdownMenuItem
]
declarations,
exports
})
export class SuiDropdownModule {}
export class SuiDropdownModule {
public static forRoot():ModuleWithProviders {
return {
ngModule: SuiDropdownRootModule
};
}
}
import { NgModule } from "@angular/core";
import { NgModule, ModuleWithProviders } from "@angular/core";
import { CommonModule } from "@angular/common";
import { SuiDimmerModule } from "../dimmer";
import { SuiTransitionModule } from "../transition";
......@@ -6,24 +6,50 @@ import { SuiUtilityModule } from "../../misc/util";
import { SuiModalService } from "./services/modal.service";
import { SuiModal } from "./components/modal";
const imports = [
CommonModule
];
const declarations = [
SuiModal
];
const entryComponents = [
SuiModal
];
const exports = [
SuiModal
];
@NgModule({
imports: [
...imports,
SuiDimmerModule.forRoot(),
SuiTransitionModule.forRoot(),
SuiUtilityModule.forRoot()
],
declarations,
entryComponents,
exports
})
export class SuiModalRootModule {}
@NgModule({
imports: [
CommonModule,
...imports,
SuiDimmerModule,
SuiTransitionModule,
SuiUtilityModule
],
declarations: [