Git Product home page Git Product logo

ng2-component's Introduction

Angular 2 Walkthrough

Angular 2 Walkthrough

TypeScript Config

{
  "compilerOptions": {
    "target": "es5",
    "module": "system",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  },
  "exclude": [
    "node_modules",
    "typings/main",
    "typings/main.d.ts"
  ]
}

TypeScript Lint Config

  • atom ng2-component/tslint.json

Typings Config

  • atom ng2-component/typings.json

npm install

npm install

Start App

Compilation, Maps and Specs

  • ng2-component/app/josoroma.app.js
  • ng2-component/app/josoroma.app.js.map
  • ng2-component/app/josoroma.app.spec.js
  • ng2-component/app/josoroma.app.spec.js.map
npm start

Unit Test

Karma

A simple tool that allows you to execute JavaScript code in multiple real browsers.

Karma is not a testing framework, nor an assertion library. Karma just launches a HTTP server, and generates the test runner HTML file we probably already know from our favourite testing framework. So for testing purposes we can use pretty much anything we like.

Jasmine

Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on browsers, DOM, or any JavaScript framework.

npm test

Unit Tests Output

chrome _test-output/tests.html

Components are self-describing

A component:

  • Knows how to interact with its host element.
  • knows how to render itself.
  • Configures dependency injection.
  • Has a well-defined public API of input and output properties.

Components are fundamental building blocks of Angular 2 applications:

  • They have well-defined inputs and outputs.
  • They have well-defined lifecycle.
  • They are self-describing.

Directives, and in particular components, are the most important part of Angular 2. They are the fundamental building blocks of Angular 2 applications. They are self-describing. They describe their public API, which is inputs and outputs. They describe their private API, which is lifecycle hooks, and how they interact with the host element.

Some components will depend on other components and services. The dependency injection module will provide those. It will construct the component tree, which is the core of any Angular 2 application.

Finally, property bindings and zones is what makes Angular 2 applications interactive.

Reference: The Core Concepts of Angular 2.

Native Angular2 Directives for Bootstrap

npm install --save bootstrap

npm install --save ng2-bootstrap

ng2-component's People

Stargazers

 avatar

Watchers

 avatar  avatar

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.