Very Basics of Angular JS

Recent years was a bright year for JavaScript developers, many JavaScript frameworks were born. With the advent of these frameworks, it can be quite a pain for developers to choose one suitable framework. Today we will talk with another JavaScript framework, which is Angular JS. This is very basic level discussion to kick start the Angular JS SPA (Single Page Application) Development.

Angular JS claims itself as super heroic JavaScript framework. Angular enhances HTML for web apps. It has functionalities to ease the process of developing web apps. HTML was first intended to build dynamic web apps that are Angular. Angular is what HTML would have been if it were designed to build web apps.

Before dig deeper to Angular features, we want to let you know that Angular is brought to you by Google. At least this fact can give you assurance Angular comes from the right people you can trust.

A strong understanding of basic JavaScript will be required to use Angular. If you feel that you’re beginner, keep going, Angular is not necessarily for advanced developers, but you will be dealing with a lot of objects so you have to be familiar with object oriented paradigm in JavaScript.

Digging into Angular JS:

– Angular JS is such a powerful SPA framework which allows writing client side application without JS coding or JS knowledge.

  • Here is an example how a simple app can be built without having any JS code.

– Angular JS is a full featured SPA Framework. It has all that needs for a good SPA[Single Page Application].

– So, the Big Picture of the Angular JS is like follows:

– Now, digging more deeper-

  • Directives and Data Binding: Directives refers to a feature to extends the vocabulary of HTML, it also can be seen as a way to teach your browser new tricks . With directive feature, we can create new HTML vocabulary that the browser will understand what it means and what it should do. You will find here all directives: http://docs.angularjs.org/api/ng#directive

  • View & Controller: between view controller there is a term $scope. Scope is a glue between view and controller. We also can call it Dependency Injector.

– Controller doesn’t know about the view. So, when a view calls a controller, it injects the scope automatically.

– View can be a full body DOM or a particular div. Different div can be used as different view in same html. Here the scope is the div in which the controller has declared.

  • Module:

– In Big Picture of Angular JS we saw Module is the root of everything. For a single page only one module can be added, but module can add many other module inside it by mentioning the dependencies or other module.

– Here is how module is defined with and without dependency- [We call it Dependency Injection]

  • Routers: In a configuration we can define the router. Router takes the URL after a “#” and loads related views. View can be defined in different html file.

  • Factories: factories are similar to Data-Model. There are four things in Angular JS for manage data. These are Factory, Service, Provider, Value.
Advertisements