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-column/one-column.layout';
export * from './one-coll-layout/one-coll.layout';

View file

@ -1,7 +1,7 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
@Component({ @Component({
selector: 'one-coll-layout', selector: 'one-column-layout',
template: ` template: `
<nga-layout> <nga-layout>
<nga-layout-header fixed> <nga-layout-header fixed>
@ -22,5 +22,5 @@ import { Component } from '@angular/core';
</nga-layout> </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 '../components/base-header/base-header.component.theme';
@import '../search-input/search-input.component.theme'; @import '../components/search-input/search-input.component.theme';
@import '../layouts/base-footer/base-footer.component.theme'; @import '../components/base-footer/base-footer.component.theme';
@mixin custom-components-theme() { @mixin custom-components-theme() {
@include base-header-theme(); @include base-header-theme();
@include base-footer-theme(); @include base-footer-theme();
@include search-input-theme(); @include search-input-theme();
} }

View file

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

View file

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