diff --git a/example/app.component.ts b/example/app.component.ts index 42ebeea..9e0fbcf 100644 --- a/example/app.component.ts +++ b/example/app.component.ts @@ -1,10 +1,10 @@ -import { Component } from '@angular/core'; +import { Component } from "@angular/core"; @Component({ - selector: 'my-app', - templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] + selector: "my-app", + templateUrl: "./app.component.html", + styleUrls: ["./app.component.css"], }) export class AppComponent { - versionDeno = Deno.version.deno; + versionDeno = Deno.version.deno; } diff --git a/example/app.module.ts b/example/app.module.ts index 01b6098..88dac8a 100644 --- a/example/app.module.ts +++ b/example/app.module.ts @@ -1,13 +1,11 @@ - -import { NgModule } from '@angular/core'; -import { ServerModule } from '../mod.ts'; -import { AppComponent } from './app.component.ts'; - +import { NgModule } from "@angular/core"; +import { ServerModule } from "../mod.ts"; +import { AppComponent } from "./app.component.ts"; @NgModule({ - imports: [ServerModule], - declarations: [AppComponent], - bootstrap: [AppComponent], - providers: [] + imports: [ServerModule], + declarations: [AppComponent], + bootstrap: [AppComponent], + providers: [], }) -export class AppModule { } \ No newline at end of file +export class AppModule {} diff --git a/example/main.ts b/example/main.ts index fd067fb..0c17654 100644 --- a/example/main.ts +++ b/example/main.ts @@ -1,21 +1,24 @@ -import { CompilerFactory, enableProdMode } from '@angular/core'; -import { bootstrap, CommonEngine } from '../mod.ts'; -import { AppModule } from './app.module.ts'; +import { CompilerFactory, enableProdMode } from "@angular/core"; +import { bootstrap, CommonEngine } from "../mod.ts"; +import { AppModule } from "./app.module.ts"; import "../reflect.ts"; -import 'zone.js'; +import "zone.js"; const { readFile } = Deno; const decoder = new TextDecoder(); -const indexHtml = decoder.decode(await readFile('index.html')); +const indexHtml = decoder.decode(await readFile("index.html")); enableProdMode(); const ref: any = await bootstrap(AppModule, indexHtml); -export const engine = new CommonEngine(ref.injector.get(CompilerFactory), AppModule); +export const engine = new CommonEngine( + ref.injector.get(CompilerFactory), + AppModule, +); // Render page -console.log(await engine.render({ document: indexHtml, url: "/" })); \ No newline at end of file +console.log(await engine.render({ document: indexHtml, url: "/" })); diff --git a/example/server.ts b/example/server.ts index 6d95dc0..bd92f03 100644 --- a/example/server.ts +++ b/example/server.ts @@ -1,26 +1,31 @@ import { serve } from "https://deno.land/std@0.59.0/http/server.ts"; -import { CompilerFactory, enableProdMode } from '@angular/core'; -import { bootstrap, CommonEngine } from '../mod.ts'; -import { AppModule } from './app.module.ts'; +import { CompilerFactory, enableProdMode } from "@angular/core"; +import { bootstrap, CommonEngine } from "../mod.ts"; +import { AppModule } from "./app.module.ts"; import "../reflect.ts"; -import 'zone.js'; +import "zone.js"; const { readFile } = Deno; const decoder = new TextDecoder(); -const indexHtml = decoder.decode(await readFile('index.html')); +const indexHtml = decoder.decode(await readFile("index.html")); enableProdMode(); const ref: any = await bootstrap(AppModule, indexHtml); -export const engine = new CommonEngine(ref.injector.get(CompilerFactory), AppModule); +export const engine = new CommonEngine( + ref.injector.get(CompilerFactory), + AppModule, +); const s = serve({ port: 8000 }); for await (const req of s) { - const body: string = await engine.render({ document: indexHtml, url: req.url }); + const body: string = await engine.render( + { document: indexHtml, url: req.url }, + ); req.respond({ body }); -} \ No newline at end of file +}