mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-21 09:50:13 +01:00
feat(rc5): update to angular rc.5
- NgaModule - module wrapper for all ng2-admin custom features - Ng Module per page - async components load - menu moved (again) to a separate file (as now each module has its own route file) - no need to import Ba* directives into the pages which have NgaModule in the import statement
This commit is contained in:
parent
983f6f1675
commit
5b7c132eac
86 changed files with 854 additions and 384 deletions
|
|
@ -1,56 +1,26 @@
|
|||
/*
|
||||
* Providers provided by Angular
|
||||
* Angular bootstraping
|
||||
*/
|
||||
import { bootstrap } from '@angular/platform-browser-dynamic';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
import { decorateModuleRef } from './app/environment';
|
||||
import { ApplicationRef } from '@angular/core';
|
||||
import { bootloader } from '@angularclass/hmr';
|
||||
/*
|
||||
* Platform and Environment
|
||||
* our providers/directives/pipes
|
||||
* App Module
|
||||
* our top level module that holds all of our components
|
||||
*/
|
||||
import { PLATFORM_PROVIDERS } from './platform/browser';
|
||||
import { ENV_PROVIDERS, decorateComponentRef } from './platform/environment';
|
||||
|
||||
import { AppModule } from './app';
|
||||
|
||||
/*
|
||||
* App Component
|
||||
* our top level component that holds all of our components
|
||||
* Bootstrap our Angular app with a top level NgModule
|
||||
*/
|
||||
import { App, APP_PROVIDERS } from './app';
|
||||
|
||||
/*
|
||||
* Bootstrap our Angular app with a top level component `App` and inject
|
||||
* our Services and Providers into Angular's dependency injection
|
||||
*/
|
||||
export function main(initialHmrState?: any): Promise<any> {
|
||||
|
||||
return bootstrap(App, [
|
||||
// To add more vendor providers please look in the platform/ folder
|
||||
...PLATFORM_PROVIDERS,
|
||||
...ENV_PROVIDERS,
|
||||
...APP_PROVIDERS,
|
||||
])
|
||||
.then(decorateComponentRef)
|
||||
export function main(): Promise<any> {
|
||||
return platformBrowserDynamic()
|
||||
.bootstrapModule(AppModule)
|
||||
.then(decorateModuleRef)
|
||||
.catch(err => console.error(err));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Vendors
|
||||
* For vendors for example jQuery, Lodash, angular2-jwt just import them anywhere in your app
|
||||
* You can also import them in vendors to ensure that they are bundled in one file
|
||||
* Also see custom-typings.d.ts as you also need to do `npm install @types/x` where `x` is your module
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Hot Module Reload
|
||||
* experimental version by @gdi2290
|
||||
*/
|
||||
if ('development' === ENV && HMR === true) {
|
||||
// activate hot module reload
|
||||
let ngHmr = require('angular2-hmr');
|
||||
ngHmr.hotModuleReplacement(main, module);
|
||||
} else {
|
||||
// bootstrap when document is ready
|
||||
document.addEventListener('DOMContentLoaded', () => main());
|
||||
}
|
||||
bootloader(main);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue