LEARNING & DEVELOPMENT Introduction to AngularJS Presented by: Shyjal Raazi
Agenda ● Need of framework in SPA ● What is angularJS ● Features of angular ● Angular concepts ● How an angular app starts ● Two way data binding ● Directives ● Controllers ● View - Controller interaction ● Modules ● Services ● Routing
Why a framework Things to consider for developing SPA DOM manipulation - how to manipulate view effectively History - What happens when pressing back button Routing - Readable urls Data binding - How to bind data from model to view View Loading - how to load view in html Hence use Frameworks
SPA framework in Javascript Implements client side mvc pattern No direct manipulation of DOM, less code, less complexity Supported by major browsers Large and fast growing open source community Help developers write more meaningful html
Features ● Dependency injection ● Two way data binding ● Declarative html approach ● Reusable components ● Routing ● Module based
Angular Concepts ● Templates ● Directive ● Expressions ● Data binding ● Scope ● Controllers ● Modules ● Filters ● Services ● Routing
How angular app starts
Two way binding https://gist.github.com/shyjal/878ade7231c9a2ceab27
Directives Directives are markers on a DOM element (such as an attribute, element name, comment or CSS class) Directives tell AngularJS's HTML compiler to attach a specified behavior to that DOM element or even transform the DOM element and its children. <body ng-app=”myapp”> <ng-view></ng-view> </body>
Controllers Provides logic to your app ng-controller directive specifies controller in html Don't modify dom from controller. so how we communicate with view? var myApp = angular.module('myApp',[]); myApp.controller('GreetingController', ['$scope', function($scope) { $scope.greeting = 'Hola!'; }]);
View - Controller interaction $scope is an object that can be used to communicate between view and controller https://gist.github.com/shyjal/aa9a0e4b15029f7ea624
Modules Re usable container for different features of an app or app itself - controllers, services, filters, directives, etc. Modules can be loaded in any order No need of use require js like AMD’s as angular have dependency injection mechanism var myApp = angular.module('myApp',[ngRoute]);
Services View-Independent business logic should not be in controller it should be in service Controllers are view specific but services are app specific
Demos Angular tabs implementation : https://gist.github.com/shyjal/bc40f48fbd8293caca6e ng-repeat Example : https://gist.github.com/shyjal/f0ab059d4df553991ea2
Routing ngRoute (a module in angular package) / UI router ( Thirdparty ) Linking between pages, what should happen on back button, readable urls
Further https://www.codeschool.com/courses/shaping-up-with-angular-js/ https://docs.angularjs.org/guide https://www.airpair.com/angularjs/posts/angular-vs-react-the-tie-breaker

Introduction to AngularJS

Editor's Notes

  • #4 This  presentation is customized for QBurst and addresses aspects of Attention to details in the Qburst environment.   The meticulous attention to detail at a micro level in this art form has resulted in a spectacular collection item.
  • #5 This  presentation is customized for QBurst and addresses aspects of Attention to details in the Qburst environment.   The meticulous attention to detail at a micro level in this art form has resulted in a spectacular collection item.
  • #6 This  presentation is customized for QBurst and addresses aspects of Attention to details in the Qburst environment.   The meticulous attention to detail at a micro level in this art form has resulted in a spectacular collection item.
  • #7 This  presentation is customized for QBurst and addresses aspects of Attention to details in the Qburst environment.   The meticulous attention to detail at a micro level in this art form has resulted in a spectacular collection item.
  • #8 This  presentation is customized for QBurst and addresses aspects of Attention to details in the Qburst environment.   The meticulous attention to detail at a micro level in this art form has resulted in a spectacular collection item.
  • #9 This  presentation is customized for QBurst and addresses aspects of Attention to details in the Qburst environment.   The meticulous attention to detail at a micro level in this art form has resulted in a spectacular collection item.
  • #10 This  presentation is customized for QBurst and addresses aspects of Attention to details in the Qburst environment.   The meticulous attention to detail at a micro level in this art form has resulted in a spectacular collection item.
  • #11 This  presentation is customized for QBurst and addresses aspects of Attention to details in the Qburst environment.   The meticulous attention to detail at a micro level in this art form has resulted in a spectacular collection item.
  • #12 This  presentation is customized for QBurst and addresses aspects of Attention to details in the Qburst environment.   The meticulous attention to detail at a micro level in this art form has resulted in a spectacular collection item.
  • #13 Test is available in word document under 'Attention to Detail' notes. This is a test that shows us how agile we are currently. It helps us gauge where we are with our attention to detail and helps us chart out what we need to do to improve this quality. The test clearly states that we need to pay very close attention to detail yet most of us seldom do.
  • #14 Test is available in word document under 'Attention to Detail' notes. This is a test that shows us how agile we are currently. It helps us gauge where we are with our attention to detail and helps us chart out what we need to do to improve this quality. The test clearly states that we need to pay very close attention to detail yet most of us seldom do.
  • #15 This  presentation is customized for QBurst and addresses aspects of Attention to details in the Qburst environment.   The meticulous attention to detail at a micro level in this art form has resulted in a spectacular collection item.
  • #16 Test is available in word document under 'Attention to Detail' notes. This is a test that shows us how agile we are currently. It helps us gauge where we are with our attention to detail and helps us chart out what we need to do to improve this quality. The test clearly states that we need to pay very close attention to detail yet most of us seldom do.
  • #17 This  presentation is customized for QBurst and addresses aspects of Attention to details in the Qburst environment.   The meticulous attention to detail at a micro level in this art form has resulted in a spectacular collection item.