Introduction to components in Angular 1.5

As we know angular 1.5 release is a big step to make transition to angular2.0 smoother. To achieve this goal angular team introduced components in version 1.5. In this post we will write a hello world component to get acquainted ourselves with components.

Its simple to create a component, angular team has made it easy to create them by providing a similar syntax just like controllers and services.
We just need to call a component function on the module.









Below is our first hello world component created.

var app=angular.module('app',[]);

app.component("helloWorld",{
   template:"Hello World"
});

index.html:

<hello-world></hello-world>

Working plunk can be found here

There is more to components, I will cover them in my future posts.

Comments

Popular Posts