Step by Step AngularJS for Beginners - Webinar Recap

Dhananjay Kumar / Wednesday, September 30, 2015

On September 25th we hosted a webinar titled “Step by Step AngularJS for Beginners” for the Indian region and we’d like to share the presentation and recorded webinar with you now! In the webinar, we covered:

  • Introduction to AngularJS
  • Introduction to SPA
  • Controller and $scope object
  • Controller hierarchy
  • Service and factory methods
  • Routing
  • CRUD operations in AngularJS application

 

You can find recording of the webinar here:

 

You can also find the presentation slides here.

Some of the questions from the webinar are below:

What is the $scope object

The $scope object glues the controller and the view in the AngularJS application. At the time of controller creation, we pass a $scope object as an input parameter to the controller. The controller attaches data and behavior to the $scope object to pass to the view.

Can we have multiple modules?

Yes an AngularJS application can have multiple modules. However it is recommended to have only one main module in the application. We set value of ng-app attribute to assign the main module.

What is a in ng-repeat =”a in authors”?

In ng-repeat directive, a is a variable. Using the variable a we will iterate through the authors array. You are free to give any name of the variable instead of a.

How do you rend Data from the Backend Database in the AngularJS?

You can do so using the following steps:

  • Write HTTP enabled service like WCF REST or Web API to perform CRUD operation on the database.
  • Create a custom AngularJS service either using factory method or service method. Use the $http service to make a call to the REST service or Web API
  • Use custom service in the controller by injecting service module in the controller module.
  • Attach returned data from the service to the controller $scope object.
  • Use the controller $scope at on the view and render the data from the database.

What is a Controller?

A controller is a JavaScript constructor function which hold application data and the business logic in AngularJS application. AngularJS creates a new object each time we use AngularJS controller.

What are Services?

Services are JavaScript functions that are created once per application. We can create services in AngularJS applications using service() , factory(), provider (), value() and constant() method. AngularJS provides us inbuilt services also like $q,$http etc.

What is $rootScope object?

$rootScope object is parent object of all the $scope objects in AngularJS. All the $scope objects has access to $rootScope properties.

Once again, thank you so much for your interest in our webinars – and we look forward to seeing you at a future webinar!