import { NgModule } from '@angular/core';
import { DatePipe } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';
import { FileUploadModule } from 'ng2-file-upload';
import { NgZorroAntdMobileModule } from 'ng-zorro-antd-mobile';

// 组件 Start
import {AppDateTime} from './components/app-datetime/app-datetime';
import {AppFormComponent} from './components/app-form/app-form.component';
import {AppFormItemComponent} from './components/app-form-item/app-form-item.component';
import {AppIcon} from './components/app-icon/app-icon';
import { AppImageUpload } from './components/app-image-upload/app-image-upload';
import { AppTextarea } from './components/app-textarea/app-textarea';
import { AppToggle } from './components/app-toggle/app-toggle';
import { AppFileUpload } from './components/app-file-upload/app-file-upload';
import { AppStepper } from './components/app-stepper/app-stepper';
import { AppPicker } from './components/app-picker/app-picker';
import { AppMPicker } from './components/app-mpicker/app-mpicker';
import { AppRadio } from './components/app-radio/app-radio';
import { AppMultipleSelect } from './components/app-multiple-select/app-multiple-select';
import { AppSelect } from './components/app-select/app-select';
import { AppListMenu } from './components/app-list-menu/app-list-menu';
import { AppDividingLine } from './components/app-dividing-line/app-dividing-line';
import { AppSlideMenu } from './components/app-slide-menu/app-slide-menu';
import { AppPalaceMenu } from './components/app-palace-menu/app-palace-menu';
import { AppQuickMenu } from './components/app-app-menu/app-app-menu';
import { AppCalendar } from './components/app-calendar/app-calendar';
import { AppScrollPaging } from './components/app-scroll-paging/app-scroll-paging';
import { AppFormDruipart } from './components/app-form-druipart/app-form-druipart.component';
import { AppLoadMore } from './components/app-load-more/app-load-more';
import { AppRotationChart } from './components/app-rotation-chart/app-rotation-chart';
import { AppImageListComponent } from './components/app-image-list/app-image-list.component';
import { AppWithtitleList } from './components/app-withtitle-list/app-withtitle-list.component';
import { AppStorestyleList } from './components/app-storestyle-list/app-storestyle-list.component';
import { AppAnchorPointList } from './components/app-anchor-point-list/app-anchor-point-list';
import { AppShrinkableGroupingList } from './components/app-shrinkable-grouping-list/app-shrinkable-grouping-list';
import { AppLevelImgtext } from './components/app-level-imgtext/app-level-imgtext.component';
import { AppHorizontalScroll } from './components/app-horizontal-scroll/app-horizontal-scroll.component';
import { AppOnlyImage } from './components/app-only-image/app-only-image.component';
import { AppTwobwithfoursImage } from './components/app-twobwithfours-image/app-twobwithfours-image.component';
import { AppLevelslideWithpriceList } from './components/app-levelslide-withprice-list/app-levelslide-withprice-list.component';
import { AppOnebwiththreesImage } from './components/app-onebwiththrees-image/app-onebwiththrees-image.component';
import { AppUserInfo } from './components/app-user-info/app-user-info';
import { AppLevelslideList } from './components/app-levelslide-list/app-levelslide-list.component';
import { AppMoreSettingComponent } from './components/app-more-setting/app-more-setting.component';
// 组件 End

// 指令 Start
import { AppEChartDirective } from './directives/app-echart';
// 指令 End

// 守卫 Start
import { AuthGuard } from './guard/auth-guard';
// 守卫 End

// 视图 Start
import { PicturePreview } from './helper/app-picture-preview/app-picture-preview';
// 视图 End

// 服务 Start
import { Loading } from './service/Loading';
// 服务 End

/**
 * 公共组件
 */
const components: any[] = [
    AppDateTime,
	AppFormComponent,
	AppFormItemComponent,
    AppIcon,
    AppImageUpload,
    AppTextarea,
    AppToggle,
    AppFileUpload,
    AppStepper,
    AppPicker,
    AppMPicker,
    AppRadio,
    AppSelect,
    AppMultipleSelect,
    AppListMenu,
    AppDividingLine,
    AppSlideMenu,
    AppPalaceMenu,
    AppQuickMenu,
    AppCalendar,
    AppScrollPaging,
    AppFormDruipart,
    AppLoadMore,
    AppRotationChart,
    AppImageListComponent,
    AppWithtitleList,
    AppStorestyleList,
    AppAnchorPointList,
    AppShrinkableGroupingList,
    AppLevelImgtext,
    AppHorizontalScroll,
    AppOnlyImage,
    AppTwobwithfoursImage,
    AppLevelslideWithpriceList,
    AppOnebwiththreesImage,
    AppUserInfo,
    AppLevelslideList,
    AppMoreSettingComponent
];

/**
 * 指令
 */
const directives: any[] = [
    AppEChartDirective
];

/**
 * 视图
 */
const pages: any[] = [
    PicturePreview
];

@NgModule({
    imports: [
        CommonModule,
        IonicModule,
        FormsModule,
        FileUploadModule,
        NgZorroAntdMobileModule
    ],
    exports: [
        IonicModule,
        NgZorroAntdMobileModule,
        ...components,
        ...directives,
        ...pages,
    ],
    declarations: [
        ...components,
        ...directives,
        ...pages,
    ],
    entryComponents: [
        ...pages,
    ],
    providers: [
        AuthGuard,
        Loading,
        DatePipe
    ]
})
export class GlobalModule { }