capsulated to directive
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
<canvas></canvas>
|
<canvas appCanvas></canvas>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>https://github.com/d3/d3-interpolate</li>
|
<li>https://github.com/d3/d3-interpolate</li>
|
||||||
|
|||||||
@@ -1,4 +1,21 @@
|
|||||||
canvas {
|
canvas {
|
||||||
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
display: flex;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 0;
|
||||||
|
padding: 3rem;
|
||||||
|
background: rgba(0,0,0,0.1);
|
||||||
|
|
||||||
|
list-style-type: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,12 @@ import { BrowserModule } from '@angular/platform-browser';
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
|
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
|
import { CanvasDirective } from './canvas/canvas.directive';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent
|
AppComponent,
|
||||||
|
CanvasDirective
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule
|
BrowserModule
|
||||||
|
|||||||
8
src/app/canvas/canvas.directive.spec.ts
Normal file
8
src/app/canvas/canvas.directive.spec.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import { CanvasDirective } from './canvas.directive';
|
||||||
|
|
||||||
|
describe('CanvasDirective', () => {
|
||||||
|
it('should create an instance', () => {
|
||||||
|
const directive = new CanvasDirective();
|
||||||
|
expect(directive).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
10
src/app/canvas/canvas.directive.ts
Normal file
10
src/app/canvas/canvas.directive.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { Directive } from '@angular/core';
|
||||||
|
|
||||||
|
@Directive({
|
||||||
|
selector: '[appCanvas]'
|
||||||
|
})
|
||||||
|
export class CanvasDirective {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user