Giter Club home page Giter Club logo

angular-two-quickstart's Introduction

ANGULAR 2 quickstart

from official doc tutorial


  • package.json identifies npm package dependencies for the project.
  • tsconfig.json defines how the TypeScript compiler generates JavaScript from the project's files.
  • typings.json provides additional definition files for libraries that the TypeScript compiler doesn't natively recognize.
  • systemjs.config.js provides information to a module loader about where to find application modules, and registers all the necessary packages. It also contains other packages that will be needed by later documentation examples.

installs:

  1. npm install
  2. (if typings folder doesnt show up) npm run typings install

Module

  • import NgModule and BrowserModule from angular/ core and platform-browser
  • might also import FormsModule, RouteModule, and HttpModule

Component

  • import Component from angular/core
  • the @Component decorator associates metadata with AppComponent component class.
    • the selector specifies a simple css selector for an html element
    • the template describes how to render the component's view
  • *** Don't forget to import your new component in the Module [declarations and bootstrap ]

Start Application

  1. create 'app/main.ts'.
  2. import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
  3. import your AppModule from './app.module'
  4. assign platformBrowserDynamic() function to a variable.
  5. now call your module as a parameter: platform.bootstrapModule(AppModule);

Define the webpage (index.html) that hosts the app

  • lives in the root
  • JavaScript libraries: core-js polyfills for older browsers, the zone.js and reflect-metadata libraries needed by Angular, and the SystemJS library for module loading.
  • Configuration file for SystemJS, and a script where you import and run the app module which refers to the main file that you just wrote.
  • The tag in the which is where your app lives!

Add some styles

  • lets create and link up a styles.css ( in the root )

Build and Run

$ npm start
Now if we make changes...
  • browsersync will hot reload the page for us.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.