Skip to content

Instantly share code, notes, and snippets.

@elcodabra
Last active September 20, 2017 08:59
Show Gist options
  • Save elcodabra/91f6cb411bbd7e027e5ce4c6c2c68fe2 to your computer and use it in GitHub Desktop.
Save elcodabra/91f6cb411bbd7e027e5ce4c6c2c68fe2 to your computer and use it in GitHub Desktop.
Bootstrapping an Angular project
<div class="container">
<div class="starter-template">
<h1>Angular Project</h1>
</div>
</div>
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {}
import { NgModule } from '@angular/core';
import { HttpModule } from '@angular/http';
import { BrowserModule } from '@angular/platform-browser';
import { BackendService } from './services/backend.service';
import { ApiService } from './services/api.service';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
HttpModule
],
providers: [ ApiService, BackendService ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Angular4 Example</title>
<base href="./">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<app-root></app-root>
</body>
</html>
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment