diff --git a/.editorconfig b/.editorconfig
index 59d9a3a..2ecd252 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -9,7 +9,7 @@ insert_final_newline = true
trim_trailing_whitespace = true
[*.ts]
-quote_type = single
+quote_type = double
[*.md]
max_line_length = off
diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index 526e1dc..3175414 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -1,12 +1,26 @@
+/*
+ * @Description: {{ByRuin}}
+ * @Version: 2.0
+ * @Author: Ruin 🍭
+ * @Date: 2022-03-03 16:21:23
+ * @LastEditors: 刘引
+ * @LastEditTime: 2022-03-04 10:52:53
+ */
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { HomeComponent } from './pages/home/home.component';
+import { UserComponent } from './pages/user/user.component';
const routes: Routes = [
+ // 路由前面的路径不需要加/
{
- path: 'home',
+ path: '',
component: HomeComponent,
},
+ {
+ path: 'user',
+ component: UserComponent,
+ },
];
@NgModule({
diff --git a/src/app/app.component.html b/src/app/app.component.html
index c6952bd..38ea303 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -4,7 +4,7 @@
* @Author: Ruin 🍭
* @Date: 2022-03-03 16:21:23
* @LastEditors: 刘引
- * @LastEditTime: 2022-03-03 17:23:41
+ * @LastEditTime: 2022-03-04 11:00:55
-->
diff --git a/src/app/app.component.scss b/src/app/app.component.scss
index e69de29..62c165e 100644
--- a/src/app/app.component.scss
+++ b/src/app/app.component.scss
@@ -0,0 +1,8 @@
+* {
+ margin: 0;
+ padding: 0;
+}
+.w {
+ width: 1200px;
+ margin: 0 auto;
+}
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 8f377f1..e714d1f 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -4,7 +4,7 @@
* @Author: Ruin 🍭
* @Date: 2022-03-03 16:21:23
* @LastEditors: 刘引
- * @LastEditTime: 2022-03-03 17:13:00
+ * @LastEditTime: 2022-03-04 10:09:24
*/
// 引入核心模块
import { NgModule } from '@angular/core';
@@ -16,6 +16,7 @@ import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
// @ngModule装饰器 @ngModule接受一个元数据对象 告诉angular如何编译和启动对象\
import { CoreModule } from './core/core.module';
+
@NgModule({
declarations: [AppComponent], //配置项目运行的组件
imports: [BrowserModule, AppRoutingModule, CoreModule], //配置当前项目运行依赖的其他模块
diff --git a/src/app/components/components.module.ts b/src/app/components/components.module.ts
index 089165f..416d959 100644
--- a/src/app/components/components.module.ts
+++ b/src/app/components/components.module.ts
@@ -1,15 +1,19 @@
+/*
+ * @Description: {{ByRuin}}
+ * @Version: 2.0
+ * @Author: Ruin 🍭
+ * @Date: 2022-03-03 16:58:41
+ * @LastEditors: 刘引
+ * @LastEditTime: 2022-03-04 10:54:07
+ */
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NewsComponent } from './news/news.component';
-
-
+import { ListComponent } from './list/list.component';
@NgModule({
- declarations: [
- NewsComponent
- ],
- imports: [
- CommonModule
- ]
+ declarations: [NewsComponent, ListComponent],
+ imports: [CommonModule],
+ exports: [NewsComponent, ListComponent],
})
-export class ComponentsModule { }
+export class ComponentsModule {}
diff --git a/src/app/components/list/list.component.html b/src/app/components/list/list.component.html
new file mode 100644
index 0000000..7c1fe15
--- /dev/null
+++ b/src/app/components/list/list.component.html
@@ -0,0 +1 @@
+
list works!
diff --git a/src/app/components/list/list.component.scss b/src/app/components/list/list.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/components/list/list.component.spec.ts b/src/app/components/list/list.component.spec.ts
new file mode 100644
index 0000000..a5d3a5c
--- /dev/null
+++ b/src/app/components/list/list.component.spec.ts
@@ -0,0 +1,25 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ListComponent } from './list.component';
+
+describe('ListComponent', () => {
+ let component: ListComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [ ListComponent ]
+ })
+ .compileComponents();
+ });
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ListComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/components/list/list.component.ts b/src/app/components/list/list.component.ts
new file mode 100644
index 0000000..011aa13
--- /dev/null
+++ b/src/app/components/list/list.component.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-list',
+ templateUrl: './list.component.html',
+ styleUrls: ['./list.component.scss']
+})
+export class ListComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit(): void {
+ }
+
+}
diff --git a/src/app/components/news/news.component.html b/src/app/components/news/news.component.html
index bced744..d34c31c 100644
--- a/src/app/components/news/news.component.html
+++ b/src/app/components/news/news.component.html
@@ -1 +1 @@
-news works!
+{{ msg }}
diff --git a/src/app/components/news/news.component.ts b/src/app/components/news/news.component.ts
index bde03ca..da1a0f3 100644
--- a/src/app/components/news/news.component.ts
+++ b/src/app/components/news/news.component.ts
@@ -1,15 +1,25 @@
+/*
+ * @Description: {{ByRuin}}
+ * @Version: 2.0
+ * @Author: Ruin 🍭
+ * @Date: 2022-03-03 16:59:15
+ * @LastEditors: 刘引
+ * @LastEditTime: 2022-03-04 10:56:36
+ */
+
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-news',
templateUrl: './news.component.html',
- styleUrls: ['./news.component.scss']
+ styleUrls: ['./news.component.scss'],
})
export class NewsComponent implements OnInit {
-
- constructor() { }
-
- ngOnInit(): void {
+ public msg: string = '我是新闻模块';
+ constructor() {
+ console.log(this.msg);
+ this.msg = '我是改变后msg的值';
+ console.log(this.msg);
}
-
+ ngOnInit(): void {}
}
diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts
index dcefa1b..cb97f84 100644
--- a/src/app/core/core.module.ts
+++ b/src/app/core/core.module.ts
@@ -4,15 +4,16 @@
* @Author: Ruin 🍭
* @Date: 2022-03-03 16:48:51
* @LastEditors: 刘引
- * @LastEditTime: 2022-03-03 17:10:50
+ * @LastEditTime: 2022-03-04 10:29:19
*/
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { PagesModule } from '../pages/pages.module';
-// import { }
+import { ComponentsModule } from '../components/components.module';
@NgModule({
declarations: [],
- imports: [CommonModule, PagesModule],
+ imports: [CommonModule, PagesModule, ComponentsModule],
+ exports: [PagesModule, ComponentsModule],
})
export class CoreModule {}
diff --git a/src/app/pages/home/components/body/body.component.html b/src/app/pages/home/components/body/body.component.html
index ee17f4e..b3115a2 100644
--- a/src/app/pages/home/components/body/body.component.html
+++ b/src/app/pages/home/components/body/body.component.html
@@ -1 +1,23 @@
-body works!
+
+body {{ content }}
+
+
+
+1+2 = {{ 1 + 2 }}
+
+
+
diff --git a/src/app/pages/home/components/body/body.component.ts b/src/app/pages/home/components/body/body.component.ts
index db08705..bf53b07 100644
--- a/src/app/pages/home/components/body/body.component.ts
+++ b/src/app/pages/home/components/body/body.component.ts
@@ -1,15 +1,21 @@
+/*
+ * @Description: {{ByRuin}}
+ * @Version: 2.0
+ * @Author: Ruin 🍭
+ * @Date: 2022-03-03 17:07:23
+ * @LastEditors: 刘引
+ * @LastEditTime: 2022-03-04 11:31:45
+ */
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-body',
templateUrl: './body.component.html',
- styleUrls: ['./body.component.scss']
+ styleUrls: ['./body.component.scss'],
})
export class BodyComponent implements OnInit {
-
- constructor() { }
-
- ngOnInit(): void {
- }
-
+ public content = '我是一个H2标签
';
+ public arrList: Array = [1111, 222, 333, 444, 555];
+ constructor() {}
+ ngOnInit(): void {}
}
diff --git a/src/app/pages/home/components/head/head.component.html b/src/app/pages/home/components/head/head.component.html
index 02847f7..0815a7d 100644
--- a/src/app/pages/home/components/head/head.component.html
+++ b/src/app/pages/home/components/head/head.component.html
@@ -1 +1,10 @@
-head works!
+
+{{ userName }}{{ title }}
+我是一个p标签
diff --git a/src/app/pages/home/components/head/head.component.ts b/src/app/pages/home/components/head/head.component.ts
index e68fdbc..fc8017e 100644
--- a/src/app/pages/home/components/head/head.component.ts
+++ b/src/app/pages/home/components/head/head.component.ts
@@ -1,15 +1,29 @@
+/*
+ * @Description: {{ByRuin}}
+ * @Version: 2.0
+ * @Author: Ruin 🍭
+ * @Date: 2022-03-03 17:07:14
+ * @LastEditors: 刘引
+ * @LastEditTime: 2022-03-04 10:23:02
+ */
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-head',
templateUrl: './head.component.html',
- styleUrls: ['./head.component.scss']
+ styleUrls: ['./head.component.scss'],
})
export class HeadComponent implements OnInit {
+ public title = '我是头部组件';
+ public userName: string = '张三';
+ private age: number = 12;
+ protected school: string = 'xx中学';
- constructor() { }
-
- ngOnInit(): void {
- }
+ public userInfo: object = {
+ userName: '李四',
+ age: 20,
+ };
+ constructor() {}
+ ngOnInit(): void {}
}
diff --git a/src/app/pages/home/home.component.html b/src/app/pages/home/home.component.html
index e018ec2..89dda1d 100644
--- a/src/app/pages/home/home.component.html
+++ b/src/app/pages/home/home.component.html
@@ -4,8 +4,10 @@
* @Author: Ruin 🍭
* @Date: 2022-03-03 17:06:15
* @LastEditors: 刘引
- * @LastEditTime: 2022-03-03 17:11:33
+ * @LastEditTime: 2022-03-04 10:53:57
-->
home works!
+
+
diff --git a/src/app/pages/home/home.module.ts b/src/app/pages/home/home.module.ts
index 66b0372..7fc4bce 100644
--- a/src/app/pages/home/home.module.ts
+++ b/src/app/pages/home/home.module.ts
@@ -1,11 +1,20 @@
+/*
+ * @Description: {{ByRuin}}
+ * @Version: 2.0
+ * @Author: Ruin 🍭
+ * @Date: 2022-03-03 17:06:01
+ * @LastEditors: 刘引
+ * @LastEditTime: 2022-03-04 11:01:41
+ */
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { HomeComponent } from './home.component';
import { HeadComponent } from './components/head/head.component';
import { BodyComponent } from './components/body/body.component';
-
+import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
declarations: [HomeComponent, HeadComponent, BodyComponent],
- imports: [CommonModule],
+ imports: [CommonModule, ComponentsModule],
+ // exports: [HomeComponent, HeadComponent, BodyComponent],
})
export class HomeModule {}
diff --git a/src/app/pages/pages.module.ts b/src/app/pages/pages.module.ts
index ad4b4a2..89b1b75 100644
--- a/src/app/pages/pages.module.ts
+++ b/src/app/pages/pages.module.ts
@@ -4,13 +4,15 @@
* @Author: Ruin 🍭
* @Date: 2022-03-03 17:03:51
* @LastEditors: 刘引
- * @LastEditTime: 2022-03-03 17:09:57
+ * @LastEditTime: 2022-03-04 11:32:51
*/
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { HomeModule } from './home/home.module';
+import { NgModule } from "@angular/core";
+import { CommonModule } from "@angular/common";
+import { HomeModule } from "./home/home.module";
+import { UserModule } from "./user/user.module";
@NgModule({
declarations: [],
- imports: [CommonModule, HomeModule],
+ imports: [CommonModule, HomeModule, UserModule],
+ // exports: [CommonModule, HomeModule, UserModule],
})
export class PagesModule {}
diff --git a/src/app/pages/user/components/info/info.component.html b/src/app/pages/user/components/info/info.component.html
new file mode 100644
index 0000000..08a916d
--- /dev/null
+++ b/src/app/pages/user/components/info/info.component.html
@@ -0,0 +1 @@
+info works!
diff --git a/src/app/pages/user/components/info/info.component.scss b/src/app/pages/user/components/info/info.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/pages/user/components/info/info.component.spec.ts b/src/app/pages/user/components/info/info.component.spec.ts
new file mode 100644
index 0000000..fead35b
--- /dev/null
+++ b/src/app/pages/user/components/info/info.component.spec.ts
@@ -0,0 +1,25 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { InfoComponent } from './info.component';
+
+describe('InfoComponent', () => {
+ let component: InfoComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [ InfoComponent ]
+ })
+ .compileComponents();
+ });
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(InfoComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/pages/user/components/info/info.component.ts b/src/app/pages/user/components/info/info.component.ts
new file mode 100644
index 0000000..388b319
--- /dev/null
+++ b/src/app/pages/user/components/info/info.component.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-info',
+ templateUrl: './info.component.html',
+ styleUrls: ['./info.component.scss']
+})
+export class InfoComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit(): void {
+ }
+
+}
diff --git a/src/app/pages/user/components/mine/mine.component.html b/src/app/pages/user/components/mine/mine.component.html
new file mode 100644
index 0000000..d55cc2f
--- /dev/null
+++ b/src/app/pages/user/components/mine/mine.component.html
@@ -0,0 +1 @@
+mine works!
diff --git a/src/app/pages/user/components/mine/mine.component.scss b/src/app/pages/user/components/mine/mine.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/pages/user/components/mine/mine.component.spec.ts b/src/app/pages/user/components/mine/mine.component.spec.ts
new file mode 100644
index 0000000..d996c34
--- /dev/null
+++ b/src/app/pages/user/components/mine/mine.component.spec.ts
@@ -0,0 +1,25 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { MineComponent } from './mine.component';
+
+describe('MineComponent', () => {
+ let component: MineComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [ MineComponent ]
+ })
+ .compileComponents();
+ });
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(MineComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/pages/user/components/mine/mine.component.ts b/src/app/pages/user/components/mine/mine.component.ts
new file mode 100644
index 0000000..daff5f6
--- /dev/null
+++ b/src/app/pages/user/components/mine/mine.component.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-mine',
+ templateUrl: './mine.component.html',
+ styleUrls: ['./mine.component.scss']
+})
+export class MineComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit(): void {
+ }
+
+}
diff --git a/src/app/pages/user/user.component.html b/src/app/pages/user/user.component.html
new file mode 100644
index 0000000..cf34aed
--- /dev/null
+++ b/src/app/pages/user/user.component.html
@@ -0,0 +1,11 @@
+
+user works!
+
+
diff --git a/src/app/pages/user/user.component.scss b/src/app/pages/user/user.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/pages/user/user.component.spec.ts b/src/app/pages/user/user.component.spec.ts
new file mode 100644
index 0000000..e6bf596
--- /dev/null
+++ b/src/app/pages/user/user.component.spec.ts
@@ -0,0 +1,25 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { UserComponent } from './user.component';
+
+describe('UserComponent', () => {
+ let component: UserComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [ UserComponent ]
+ })
+ .compileComponents();
+ });
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(UserComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/pages/user/user.component.ts b/src/app/pages/user/user.component.ts
new file mode 100644
index 0000000..5df0c83
--- /dev/null
+++ b/src/app/pages/user/user.component.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-user',
+ templateUrl: './user.component.html',
+ styleUrls: ['./user.component.scss']
+})
+export class UserComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit(): void {
+ }
+
+}
diff --git a/src/app/pages/user/user.module.ts b/src/app/pages/user/user.module.ts
new file mode 100644
index 0000000..858e5c7
--- /dev/null
+++ b/src/app/pages/user/user.module.ts
@@ -0,0 +1,20 @@
+/*
+ * @Description: {{ByRuin}}
+ * @Version: 2.0
+ * @Author: Ruin 🍭
+ * @Date: 2022-03-04 10:42:33
+ * @LastEditors: 刘引
+ * @LastEditTime: 2022-03-04 11:02:36
+ */
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { InfoComponent } from './components/info/info.component';
+import { MineComponent } from './components/mine/mine.component';
+import { UserComponent } from './user.component';
+
+@NgModule({
+ declarations: [InfoComponent, MineComponent, UserComponent],
+ imports: [CommonModule],
+ // exports: [InfoComponent, MineComponent, UserComponent],
+})
+export class UserModule {}