2
0

capsulated to directive

This commit is contained in:
2018-05-10 17:13:29 +02:00
parent c46c23979d
commit 4617e90374
5 changed files with 39 additions and 2 deletions

View File

@@ -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>

View File

@@ -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;
} }

View File

@@ -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

View File

@@ -0,0 +1,8 @@
import { CanvasDirective } from './canvas.directive';
describe('CanvasDirective', () => {
it('should create an instance', () => {
const directive = new CanvasDirective();
expect(directive).toBeTruthy();
});
});

View File

@@ -0,0 +1,10 @@
import { Directive } from '@angular/core';
@Directive({
selector: '[appCanvas]'
})
export class CanvasDirective {
constructor() { }
}