Skip to main content

Posts

Showing posts with the label angular 2 hello world example

Angular 2 Components Example

In Angular 2, the components are the main way to build or specify HTML elements and business logic on the page. In AngularJs 1, we are handling using scope, directives and controllers but all those concepts are using in a single combined that is called components. The component is the core functionality of Angular 2 app but we need to know to pass the data in to the components to configure them.   Stayed Informed -   Angular 2 Tutorials For Quick Start To build an Angular 2 application you define a set of components, for every HTML elements, views, and route.   Angular 2 applications must have a root component that contains all other components. That means all Angular 2 applications have a component tree. Application è Component  è Component1 and Component2 Example of Components import { Component } from '@angular/core' ; import { CommonModule } from '@angular/common' ; @ Component({ selector : 'home' , templat...

angular 2 hello world example

Hello everyone, I am going to share an interesting and basic example(angular 2 hello world) using  Angular 2 .  I also setup the code in plnkr http://embed.plnkr.co/jI6Nro/       Table of contents 1.        index.html 2.        main.es6.js 3.        style.css You can see the all code files on plnkr http://embed.plnkr.co/jI6Nro/ The Angular 2 hello world example as given below. //index.html < !DOCTYPE html > < html > < head >     < link rel ="stylesheet" href ="style.css" />     < script src ="https://jspm.io/system@0.18.17.js"></ script >     < script src ="https://code.angularjs.org/2.0.0-beta.8/angular2-polyfills.js"></ script >     < script src ="https://code.angularjs.org/2.0.0-beta.8/Rx.min.js"></ ...