AngularJS hello world example

AngularJs is an open-source web application framework mainly maintained by Google . It aims to simplify both the development and the testing of such applications by providing a framework for client-side model–view–controller (MVC) and model–view–viewmodel (MVVM) architectures, It helps you to solve major issues with single web page applications. You need to write very less code to achieve complex functionalities.

Live demo:

Explanation:

We have included angular js CDN in line number 6

If you see closely, we have used ng-app attribute with div element. It is called angular directive (We will learn about this letter). We just need to know that it tells angular about starting point of angular flow. So in this div element , we will have angular js related code.

You can understand ng-app as main() method in java

{{ }} defines angular expression, so whatever inside it will be evaluated. You can see {{10+40}} becomes 50 here.

Live demo:

Explanation :

In this example, we have used textbox, so whatever you write in textbox, get reflected with hello.

We have used ng-app same as previous example.

If you notice, we have also used ng-model this time. It is also angular directive and it binds state of model and view, so whatever you write in text box, it get reflected in {{helloworld}} . You will be able to understand more about in the coming tutorials.