Skip to content

Instantly share code, notes, and snippets.

@petyosi
Created February 9, 2018 13:29
Show Gist options
  • Save petyosi/84914561eab4a41bcfb69fc7392c9125 to your computer and use it in GitHub Desktop.
Save petyosi/84914561eab4a41bcfb69fc7392c9125 to your computer and use it in GitHub Desktop.
// boot.ts
import {platformBrowserDynamic} from "@angular/platform-browser-dynamic";
import {enableProdMode} from "@angular/core";
import {AppModule} from "./app.module";
declare var process;
if (process.env.ENV === 'production') {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
// app.module.ts
import {NgModule} from "@angular/core";
import {BrowserModule} from "@angular/platform-browser";
// application
import {AppComponent} from "./app.component";
@NgModule({
imports: [
BrowserModule
],
declarations: [
AppComponent
],
bootstrap: [AppComponent]
})
export class AppModule {
}
// app.component.ts
import {Component} from "@angular/core";
@Component({
selector: 'my-app',
template: `
Hello {{ name }}
`
})
export class AppComponent {
name: string = "Sean";
constructor() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment