commit
This commit is contained in:
@@ -1 +1,23 @@
|
||||
<p>body works!</p>
|
||||
<!--
|
||||
* @Description: {{ByRuin}}
|
||||
* @Version: 2.0
|
||||
* @Author: Ruin 🍭
|
||||
* @Date: 2022-03-03 17:07:23
|
||||
* @LastEditors: 刘引
|
||||
* @LastEditTime: 2022-03-04 11:30:17
|
||||
-->
|
||||
<p>body {{ content }}</p>
|
||||
<!-- 渲染html标签 -->
|
||||
<span [innerHTML]="content"></span>
|
||||
<!-- 进行简单计算 -->
|
||||
<span>1+2 = {{ 1 + 2 }}</span>
|
||||
<!-- 使用数据 -->
|
||||
<hr />
|
||||
<div>
|
||||
<head>
|
||||
开始进行数组循环渲染
|
||||
</head>
|
||||
<ul>
|
||||
<li *ngFor="let item of arrList">{{ item }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -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>我是一个H2标签</h2>';
|
||||
public arrList: Array<Number> = [1111, 222, 333, 444, 555];
|
||||
constructor() {}
|
||||
ngOnInit(): void {}
|
||||
}
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
<p>head works!</p>
|
||||
<!--
|
||||
* @Description: {{ByRuin}}
|
||||
* @Version: 2.0
|
||||
* @Author: Ruin 🍭
|
||||
* @Date: 2022-03-03 17:07:14
|
||||
* @LastEditors: 刘引
|
||||
* @LastEditTime: 2022-03-04 11:04:54
|
||||
-->
|
||||
<p>{{ userName }}{{ title }}</p>
|
||||
<p [title]="userName">我是一个p标签</p>
|
||||
|
||||
@@ -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 {}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
-->
|
||||
<p>home works!</p>
|
||||
<app-head></app-head>
|
||||
<app-news></app-news>
|
||||
<app-list></app-list>
|
||||
<app-body></app-body>
|
||||
|
||||
@@ -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 {}
|
||||
|
||||
@@ -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 {}
|
||||
|
||||
1
src/app/pages/user/components/info/info.component.html
Normal file
1
src/app/pages/user/components/info/info.component.html
Normal file
@@ -0,0 +1 @@
|
||||
<p>info works!</p>
|
||||
25
src/app/pages/user/components/info/info.component.spec.ts
Normal file
25
src/app/pages/user/components/info/info.component.spec.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { InfoComponent } from './info.component';
|
||||
|
||||
describe('InfoComponent', () => {
|
||||
let component: InfoComponent;
|
||||
let fixture: ComponentFixture<InfoComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ InfoComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(InfoComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
15
src/app/pages/user/components/info/info.component.ts
Normal file
15
src/app/pages/user/components/info/info.component.ts
Normal file
@@ -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 {
|
||||
}
|
||||
|
||||
}
|
||||
1
src/app/pages/user/components/mine/mine.component.html
Normal file
1
src/app/pages/user/components/mine/mine.component.html
Normal file
@@ -0,0 +1 @@
|
||||
<p>mine works!</p>
|
||||
25
src/app/pages/user/components/mine/mine.component.spec.ts
Normal file
25
src/app/pages/user/components/mine/mine.component.spec.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { MineComponent } from './mine.component';
|
||||
|
||||
describe('MineComponent', () => {
|
||||
let component: MineComponent;
|
||||
let fixture: ComponentFixture<MineComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ MineComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(MineComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
15
src/app/pages/user/components/mine/mine.component.ts
Normal file
15
src/app/pages/user/components/mine/mine.component.ts
Normal file
@@ -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 {
|
||||
}
|
||||
|
||||
}
|
||||
11
src/app/pages/user/user.component.html
Normal file
11
src/app/pages/user/user.component.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!--
|
||||
* @Description: {{ByRuin}}
|
||||
* @Version: 2.0
|
||||
* @Author: Ruin 🍭
|
||||
* @Date: 2022-03-04 10:45:56
|
||||
* @LastEditors: 刘引
|
||||
* @LastEditTime: 2022-03-04 10:48:52
|
||||
-->
|
||||
<p>user works!</p>
|
||||
<app-info></app-info>
|
||||
<app-mine></app-mine>
|
||||
0
src/app/pages/user/user.component.scss
Normal file
0
src/app/pages/user/user.component.scss
Normal file
25
src/app/pages/user/user.component.spec.ts
Normal file
25
src/app/pages/user/user.component.spec.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { UserComponent } from './user.component';
|
||||
|
||||
describe('UserComponent', () => {
|
||||
let component: UserComponent;
|
||||
let fixture: ComponentFixture<UserComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ UserComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(UserComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
15
src/app/pages/user/user.component.ts
Normal file
15
src/app/pages/user/user.component.ts
Normal file
@@ -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 {
|
||||
}
|
||||
|
||||
}
|
||||
20
src/app/pages/user/user.module.ts
Normal file
20
src/app/pages/user/user.module.ts
Normal file
@@ -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 {}
|
||||
Reference in New Issue
Block a user