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:
nixa 2016-08-26 17:37:59 +03:00
parent 983f6f1675
commit 5b7c132eac
86 changed files with 854 additions and 384 deletions

View file

@ -1,10 +1,10 @@
import './app.loader.ts';
import {Component, ViewEncapsulation} from "@angular/core";
import {AppState} from "./app.state";
import {BaThemeConfigProvider, BaThemeConfig} from "./theme";
import {BaThemeRun} from "./theme/directives";
import {BaImageLoaderService, BaThemePreloader, BaThemeSpinner} from "./theme/services";
import {layoutPaths} from "./theme/theme.constants";
import { Component, ViewEncapsulation } from '@angular/core';
import { GlobalState } from './global.state';
import { BaThemeConfigProvider, BaThemeConfig } from './theme';
import { BaThemeRun } from './theme/directives';
import { BaImageLoaderService, BaThemePreloader, BaThemeSpinner } from './theme/services';
import { layoutPaths } from './theme/theme.constants';
/*
* App Component
@ -26,9 +26,12 @@ import {layoutPaths} from "./theme/theme.constants";
})
export class App {
isMenuCollapsed:boolean = false;
isMenuCollapsed: boolean = false;
constructor(private _state:AppState, private _imageLoader:BaImageLoaderService, private _spinner:BaThemeSpinner, private _config:BaThemeConfig) {
constructor(private _state: GlobalState,
private _imageLoader: BaImageLoaderService,
private _spinner: BaThemeSpinner) {
this._loadImages();
this._state.subscribe('menu.isCollapsed', (isCollapsed) => {
@ -36,14 +39,14 @@ export class App {
});
}
public ngAfterViewInit():void {
public ngAfterViewInit(): void {
// hide spinner once all loaders are completed
BaThemePreloader.load().then((values) => {
this._spinner.hide();
});
}
private _loadImages():void {
private _loadImages(): void {
// register some loaders
BaThemePreloader.registerLoader(this._imageLoader.load(layoutPaths.images.root + 'sky-bg.jpg'));
}