17.10.2018 Views

Angular

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

System.import('app').catch(function(err){ console.error(err); });<br />

<br />

<br />

<br />

<br />

Loading...<br />

<br />

<br />

Now we're ready to create our first component. Create a folder named app inside our front folder.<br />

command line:<br />

mkdir app<br />

cd app<br />

Let's make the following files named main.ts, app.module.ts, app.component.ts<br />

main.ts:<br />

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';<br />

import { AppModule } from './app.module';<br />

const platform = platformBrowserDynamic();<br />

platform.bootstrapModule(AppModule);<br />

app.module.ts:<br />

import { NgModule } from '@angular/core';<br />

import { BrowserModule } from '@angular/platform-browser';<br />

import { HttpModule } from "@angular/http";<br />

import { AppComponent }<br />

from './app.component';<br />

@NgModule({<br />

imports: [<br />

BrowserModule,<br />

HttpModule<br />

],<br />

declarations: [<br />

AppComponent<br />

],<br />

providers:[ ],<br />

bootstrap: [ AppComponent ]<br />

})<br />

export class AppModule {}<br />

app.component.ts:<br />

GoalKicker.com – <strong>Angular</strong> 2 Notes for Professionals 6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!