Skip to content

Commit 846d4c9

Browse files
committed
项目初始化
1 parent c90c422 commit 846d4c9

14 files changed

+142
-4
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"vsicons.presets.angular": true
3+
}

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@
1717
"@angular/core": "^4.0.0",
1818
"@angular/forms": "^4.0.0",
1919
"@angular/http": "^4.0.0",
20+
"@angular/material": "^2.0.0-beta.3",
2021
"@angular/platform-browser": "^4.0.0",
2122
"@angular/platform-browser-dynamic": "^4.0.0",
2223
"@angular/router": "^4.0.0",
24+
"@types/hammerjs": "^2.0.34",
2325
"core-js": "^2.4.1",
26+
"@angular-mdl/core": "^4.0.3",
27+
"material-design-icons": "^3.0.1",
28+
"material-design-lite": "^1.3.0",
2429
"rxjs": "^5.1.0",
2530
"zone.js": "^0.8.4"
2631
},

src/app/app.component.html

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1-
<h1>
2-
{{title}}
3-
</h1>
1+
<div class="container" mdl-shadow="2">
2+
<mdl-layout>
3+
<mdl-layout-content>
4+
<div class="layout-header">
5+
<app-layout-header></app-layout-header>
6+
</div>
7+
<div class="main-body">
8+
<div class="layout-nav">
9+
<app-layout-nav></app-layout-nav>
10+
</div>
11+
<div class="layout-body">
12+
<app-layout-body></app-layout-body>
13+
</div>
14+
</div>
15+
</mdl-layout-content>
16+
</mdl-layout>
17+
</div>

src/app/app.module.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
1+
// Angular模块
12
import { BrowserModule } from '@angular/platform-browser';
23
import { NgModule } from '@angular/core';
34
import { FormsModule } from '@angular/forms';
45
import { HttpModule } from '@angular/http';
56

7+
// App模块
68
import { AppComponent } from './app.component';
79

10+
// 第三方模块
11+
import { MdlModule } from '@angular-mdl/core';
12+
13+
// 项目内模块
14+
import { LayoutModule } from './layout/layout.module';
15+
816
@NgModule({
917
declarations: [
1018
AppComponent
1119
],
1220
imports: [
21+
// Angular模块
1322
BrowserModule,
1423
FormsModule,
15-
HttpModule
24+
HttpModule,
25+
// 第三方模块
26+
MdlModule,
27+
// 项目内模块
28+
LayoutModule
29+
// App模块
1630
],
1731
providers: [],
1832
bootstrap: [AppComponent]

src/app/layout/header/header.component.css

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<p>
2+
header works!
3+
</p>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { HeaderComponent } from './header.component';
4+
5+
describe('HeaderComponent', () => {
6+
let component: HeaderComponent;
7+
let fixture: ComponentFixture<HeaderComponent>;
8+
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [ HeaderComponent ]
12+
})
13+
.compileComponents();
14+
}));
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(HeaderComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should be created', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-header',
5+
templateUrl: './header.component.html',
6+
styleUrls: ['./header.component.css']
7+
})
8+
export class HeaderComponent implements OnInit {
9+
10+
constructor() { }
11+
12+
ngOnInit() {
13+
}
14+
15+
}

src/app/layout/layout.module.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
import { HeaderComponent } from './header/header.component';
4+
import { BodyComponent } from './body/body.component';
5+
import { NavComponent } from './nav/nav.component';
6+
import { TabComponent } from './body/tab/tab.component';
7+
8+
@NgModule({
9+
imports: [
10+
CommonModule
11+
],
12+
declarations: [HeaderComponent, BodyComponent, NavComponent, TabComponent]
13+
})
14+
export class LayoutModule { }

src/app/layout/nav/nav.component.css

Whitespace-only changes.

0 commit comments

Comments
 (0)