-
-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add dialog for homeclick && fixed #6
- Loading branch information
Showing
10 changed files
with
103 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<h2 mat-dialog-title>{{data.name}}</h2> | ||
<mat-dialog-content class="mat-typography"> | ||
<p *ngIf="data.homepage">首页:<a href="{{data.homepage}}" target="_blank">{{data.homepage}}</a></p> | ||
{{data.description}} | ||
</mat-dialog-content> |
Empty file.
26 changes: 26 additions & 0 deletions
26
src/app/features/atom-dialog/atom-dialog.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { AtomDialogComponent } from './atom-dialog.component'; | ||
import { SharedModule } from '../../shared/shared.module'; | ||
|
||
describe('AtomDialogComponent', () => { | ||
let component: AtomDialogComponent; | ||
let fixture: ComponentFixture<AtomDialogComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [SharedModule], | ||
declarations: [AtomDialogComponent], | ||
}).compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(AtomDialogComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Component, Inject, OnInit } from '@angular/core'; | ||
import { MAT_DIALOG_DATA } from '@angular/material/dialog'; | ||
import { Atom } from '../shared'; | ||
|
||
@Component({ | ||
selector: 'app-atom-dialog', | ||
templateUrl: './atom-dialog.component.html', | ||
styleUrls: ['./atom-dialog.component.scss'], | ||
}) | ||
export class AtomDialogComponent implements OnInit { | ||
constructor(@Inject(MAT_DIALOG_DATA) public data: Atom) { | ||
console.log(this.data); | ||
} | ||
|
||
ngOnInit(): void {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
export interface HighlightState { | ||
alkali: boolean; | ||
alkaline: boolean; | ||
lant: boolean; | ||
actinoid: boolean; | ||
transition: boolean; | ||
postTransition: boolean; | ||
metalloid: boolean; | ||
nonMetal: boolean; | ||
nobleGas: boolean; | ||
alkali: boolean; | ||
alkaline: boolean; | ||
lant: boolean; | ||
actinoid: boolean; | ||
transition: boolean; | ||
postTransition: boolean; | ||
metalloid: boolean; | ||
nonMetal: boolean; | ||
nobleGas: boolean; | ||
} | ||
|
||
export interface Atom { | ||
number: number; | ||
category: string; | ||
symbol: string; | ||
name: string; | ||
atomic_mass: number; | ||
phase: string; | ||
xpos: number; | ||
ypos: number; | ||
blurry: boolean; | ||
name: string; | ||
homepage: string; | ||
description: string; | ||
category: string; | ||
number: number; | ||
symbol: string; | ||
pd: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters