refactor(app): make a bit more neat structure

This commit is contained in:
Dmitry Nehaychik 2017-04-28 14:59:24 +03:00
parent 91c780c256
commit 44f2f562a9
20 changed files with 24 additions and 17 deletions

View file

View file

@ -0,0 +1 @@
Application-wise data providers.

View file

View file

@ -0,0 +1,3 @@
export * from '../components/base-header/base-header.component';
export * from '../components/base-footer/base-footer.component';
export * from '../components/search-input/search-input.component';

View file

View file

@ -1,2 +1 @@
export * from './base-header/base-header.component';
export * from './one-coll-layout/one-coll.layout';
export * from './one-column/one-column.layout';

View file

@ -1,7 +1,7 @@
import { Component } from '@angular/core';
@Component({
selector: 'one-coll-layout',
selector: 'one-column-layout',
template: `
<nga-layout>
<nga-layout-header fixed>
@ -22,5 +22,5 @@ import { Component } from '@angular/core';
</nga-layout>
`,
})
export class OneCollLayoutComponent {
export class OneColumnLayoutComponent {
}

View file

View file

@ -1,9 +1,9 @@
@import '../layouts/base-header/base-header.component.theme';
@import '../search-input/search-input.component.theme';
@import '../layouts/base-footer/base-footer.component.theme';
@import '../components/base-header/base-header.component.theme';
@import '../components/search-input/search-input.component.theme';
@import '../components/base-footer/base-footer.component.theme';
@mixin custom-components-theme() {
@include base-header-theme();
@include base-footer-theme();
@include search-input-theme();
}
}

View file

@ -12,9 +12,8 @@ import {
NgaUserModule,
} from '@nga/theme';
import { SearchInputComponent } from './search-input/search-input.component';
import { OneCollLayoutComponent, BaseHeaderComponent } from './layouts';
import { BaseFooterComponent } from './layouts/base-footer/base-footer.component';
import { SearchInputComponent, BaseHeaderComponent, BaseFooterComponent } from './components';
import { OneColumnLayoutComponent } from './layouts';
const BASE_MODULES = [
CommonModule,
@ -31,8 +30,14 @@ const NGA_MODULES = [
NgaUserModule,
];
const COMPONENTS = [
BaseHeaderComponent,
BaseFooterComponent,
SearchInputComponent,
];
const LAYOUTS = [
OneCollLayoutComponent,
OneColumnLayoutComponent,
BaseHeaderComponent,
BaseFooterComponent,
];
@ -46,13 +51,12 @@ const LAYOUTS = [
exports: [
...BASE_MODULES,
...NGA_MODULES,
...COMPONENTS,
...LAYOUTS,
SearchInputComponent,
],
declarations: [
...COMPONENTS,
...LAYOUTS,
SearchInputComponent,
BaseFooterComponent,
],
})
export class ThemeModule {

View file

@ -7,10 +7,10 @@ import { Component } from '@angular/core';
'../@theme/styles/pure/pure.theme.scss',
],
template: `
<one-coll-layout>
<one-column-layout>
<nga-menu></nga-menu>
<router-outlet></router-outlet>
</one-coll-layout>
</one-column-layout>
`,
})
export class PagesComponent {