python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
angular 2 hello world example

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

      Table of contents

1.       index.html
2.       main.es6.js
3.       style.css

You can see the all code files on plnkr

The Angular 2 hello world example as given below.

<!DOCTYPE html>
    <link rel="stylesheet" href="style.css" />
    <script src="[email protected]"></script>
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
            paths: {
                'main.js': 'main.js'
    <hello-world-example />

import {Component} from 'angular2/core';
import {bootstrap} from 'angular2/platform/browser';

    selector: 'hello-world-example',
    providers: [myService],
    template: '<b class="color"><br/>{{helloworld}} world!"' +'<br/></b> {{curentdate}} <br/><br/><a href="{{webURL}}">Click for more detail..</a>'

class myApp {
    constructor(service: myService) {
        this.helloworld = service.getMesg();
        this.curentdate =service.getDate();
        this.webURL =service.getWebURL();

class myService {
    getMesg() {
        return 'Welcome you, in Angular 2! "Hello';
        return new Date();
        return ""

//Start aplication from here.

The live demo example as given below.


Hi there! Welcome to my blog. My name is Anil Singh. I'm a author of this blog. For more detail about me, kindly refer to this link..
My Blogs - and
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like Powered by Blogger.
ASK Questions