SlideShare a Scribd company logo
AngularJS
• What is AngularJS
• AngularJS main components
– View / Controller / Module / Scope
• Scope Inheritance.
• Two way data binding
– $watch / $digest / $apply
– Dirty Checking
• DI - Dependence Injection
• $provider vs $factory vs $service
What is AngularJS
• Javascript Front-end Framework (100% Javascript
& 100% client side)
• For building dynamic web apps.
• Angular is what HTML would have been, had it
been designed for applications.
• HTML is a great declarative language for static
documents.
• But It does not contain much in the way of
creating applications.
• It lets you use HTML as template language.
• It lets you extend HTML’s syntax to express
your application’s components clearly and
succinctly.
• Angular's data binding and dependency
injection eliminate much of the code you
would otherwise have to write
• MVC design parttern to organize codes.

Recommended for you

Angular Advanced Routing
Angular Advanced RoutingAngular Advanced Routing
Angular Advanced Routing

Technical presentation given by Laurent Duveau at the Angular Vancouver Meetup on June 07, 2018. https://www.meetup.com/vanangular/events/250883030/

angularjavascriptweb development
Angular Introduction By Surekha Gadkari
Angular Introduction By Surekha GadkariAngular Introduction By Surekha Gadkari
Angular Introduction By Surekha Gadkari

This document provides an introduction to Angular, including its history and architecture. Angular is a TypeScript-based front-end framework for building client-side dynamic web applications. It discusses when to use Angular, such as for large complex projects or apps with dynamic content. The document also covers Angular's modules, components, data binding, directives, services and dependency injection.

angularangular introangular 8
Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)

The document proposes a new version 2.0 format for Postman collections that is: - A minimalist and flexible JSON guideline for defining APIs and collections in a human readable way. It allows for extensive documentation, testing, and organization of API definitions. - Built on a JSON structure that can be easily extended and manipulated via a Node.js module. It supports all aspects of API management from modeling to testing to documentation. - Designed to be intuitive with a low learning curve, while still providing the flexibility to extensively document APIs, collections and their components through embedded descriptions and metadata.

apipostmanmodeling
Traditional Solution
HTML
<37% LOC
JavaScript
>63% LOC
AngularJS solution
HTML
<59% LOC
JavaScript
>41% LOC
Model
MVC
View
Controller
Template

Recommended for you

Angular
AngularAngular
Angular

This document discusses Angular components, dependency injection, and routing. It defines Angular as being built on modules, components, templates, and services. Components are the basic building blocks and make up a hierarchical tree structure. Dependency injection allows components to access services. Routing in Angular uses a router to navigate between views and components based on URL changes.

angulartypescript
Nestjs MasterClass Slides
Nestjs MasterClass SlidesNestjs MasterClass Slides
Nestjs MasterClass Slides

Slides from the NestJS MasterClass. We learned how to build JavaScript server-side applications with NestJS - A progressive NodeJS framework built with TypeScript. You can find the code on GitHub: https://github.com/nirkaufman/task-manager

javascriptnodejsnestjs
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services

Http Service will help us fetch external data, post to it, etc. We need to import the http module to make use of the http service. Let us consider an example to understand how to make use of the http service.

angularwebstack academy bangalorefullstack web developer
Template -> View
Template
Compile
View - DOM
Directive
• AngularJs is what HTML could have been if it had
been designed for web application.
• HTML is a markup language for describing web
document.
Directive
• A directive is a maker on a DOM element that tells
Angular to run or reference some JS code to:
– Attach a specified behaviors to that DOM.
– Transform the DOM on the fly.
<map id="map_canvas" x="46.8765" y="-3.32910"></map>
AngularJs presentation

Recommended for you

MongoDB and Node.js
MongoDB and Node.jsMongoDB and Node.js
MongoDB and Node.js

Presentation on MongoDB and Node.JS. We describe how to do basic CRUD operations (insert, remove, update, find) how to aggregate using node.js. We also discuss a bit of Meteor, MEAN Stack and other ODMs and projects on Javascript and MongoDB

mongodbnode.js
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - Directives

A directive is a custom HTML element that is used to extend the power of HTML. Angular 2 has the following directives that get called as part of the BrowserModule module. ngif ngFor If you view the app.module.ts file, you will see the following code and the BrowserModule module defined. By defining this module, you will have access to the 2 directives.

angularwebstack academy bangalorefullstack web developer
An Overview on Nuxt.js
An Overview on Nuxt.jsAn Overview on Nuxt.js
An Overview on Nuxt.js

Amongst all the big front end frameworks, Nuxt.js stands out as it has a lot of advantages over the other. This presentation covers an overview of Nuxt.js and how Server Side Rendering helps in improving the SEO of a site.

nuxt.jswhat is server side rendering?html head tags
Expression
• Allow you to insert dynamic values into your
html.
I am number {{0 + 1}} -> I am number 1
{{"hello" + " you"}} -> hello you
{{“Hi," + user.name}} -> Hi, Tom
Modules
• A module is a collection of services, directives,
controllers, filters, and configuration
information
• Where we write pieces of our angular
application.
• Makes our code more maintainable, testable
and readable.
Module
Controller
• Controller is a JavaScript function.
• Controller contains business logic behind the
application to decorate the scope with
functions and data.
• The ngController directive specifies a
Controller class.

Recommended for you

Angular modules in depth
Angular modules in depthAngular modules in depth
Angular modules in depth

- Angular modules help organize an application into blocks of related functionality. Modules declare components, directives, pipes and services that belong to that module. - There are different types of modules like root modules, feature modules, and shared modules. The root module launches the app. Feature modules extend functionality. Shared modules contain reusable constructs. - Modules can import and export specific constructs to make them available to other modules. Services declared in a module are singletons app-wide unless the module is lazy loaded. Core modules contain global services imported by the root module only.

angular2angularjsjavascript
ES6 presentation
ES6 presentationES6 presentation
ES6 presentation

The document discusses key features of ECMAScript 6 (ES6), including: - Default parameters, template literals, multi-line strings, spread operator, and enhanced object literals which add concise syntaxes. - Arrow functions which provide a shorter syntax for writing anonymous functions. - Block-scoped constructs like let and const that add block scoping to variables and constants. - Classes which provide a cleaner way to define constructor functions and objects. - Hoisting differences between function declarations and class declarations. - Using ES6 today by compiling it to ES5 using a tool like Babel.

engineeringjavascriptcode
Nuxt.JS Introdruction
Nuxt.JS IntrodructionNuxt.JS Introdruction
Nuxt.JS Introdruction

This document provides an overview of a minimalist framework called Nuxt.js for creating universal server-side rendered (SSR) applications using Vue.js. Some key points covered include: - Nuxt.js allows developers to write Vue components and pages while abstracting away concerns of client-server code splitting and routing. - Features include automatic code splitting, SSR, routing, static file serving, bundling/minifying, and error handling. - The framework uses a pages/ directory to define routes and components and includes Vuex and Vue-Router functionality out of the box. - Async data loading, custom layouts, global meta tags, and asset handling are also

vuejsjavascriptvue.js
Controller
AngularJs presentation
Scope
• scope is an object that refers to the
application model.
• Scope is the glue between application
controller and the view.
• Scope provide $watch to observe model
mutations.
Controller
Model

Recommended for you

Angular
AngularAngular
Angular

Angular is an open-source TypeScript-based front-end web application platform maintained by Google. It uses MVC and dependency injection patterns. Key features include components, services, routing and calling remote services. Version 1 was released in 2009 as AngularJS and the latest version is Angular 5. It is used to build large web applications and sites like Google and Uber.

angularjavascript
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation

ASP.NET MVC is a framework from Microsoft that separates an application's logic, presentation, and data access into three distinct components: models, views, and controllers. This separation of concerns makes the application easier to manage, test, and develop for large teams. ASP.NET MVC uses friendly URLs, does not rely on view state or server-based forms, and supports test-driven development better than traditional ASP.NET Web Forms applications.

Angular 14.pptx
Angular 14.pptxAngular 14.pptx
Angular 14.pptx

Angular is a TypeScript-based framework for building single-page web applications. Some key points: - Angular 14 is the latest version, released in June 2022. It introduced features like standalone components and typed forms. - Angular provides advantages like cross-platform support, improved speed/performance, and support for unit testing. - The Angular CLI is used to initialize, develop, and maintain Angular apps from the command line. Commands include ng new to create a new app and ng help to view available commands.

codes
AngularJs presentation
Out of scope
Ng-controller alias
AngularJs presentation

Recommended for you

Spring MVC
Spring MVCSpring MVC
Spring MVC

The document describes the Spring MVC request lifecycle and how requests are handled in Spring MVC. It discusses how the DispatcherServlet receives requests and uses handler mappings to determine which controller should handle each request. It then describes how controllers process requests, returning a ModelAndView which is used to render the view. It also provides details on configuring controllers, view resolvers, and handler mappings, as well as examples of different types of controllers like command, form, and multi-action controllers.

emprovisespringmvc
Angular
AngularAngular
Angular

Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript. It is an update to AngularJS with a focus on mobile and typesafety. Major versions include Angular 1.x, 2.x, 4.x and 5.x. Angular uses components, services and modules to build applications with templates and styles. It is compiled to JavaScript using transpilation and supports AOT and JIT compilation. Common tools used with Angular include the Angular CLI, Webpack and Zone.js.

angularangularjstypescript
AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example

This document provides a summary of the AngularJS framework. It discusses the following key points in 3 sentences: 1. AngularJS aims to make HTML better suited for building applications by teaching the browser new syntax like directives. This allows more of the application logic to be handled in the declarative HTML instead of JavaScript code. 2. Angular follows an MVC pattern where the controller contains the business logic and data, the view displays the data through bindings, and the scope acts as a synchronization mechanism between the model and view. 3. Features like data binding, directives, dependency injection and routing allow building dynamic and interactive single-page applications by synchronizing the model and view through declarative templates and separating concerns

frameworksgoogleweb design and development
AngularJs presentation
Angular Scope Inheritance
• In AngularJS, a child scope normally
prototypically inherits from its parent scope
• Child scope:
– scope of child controller
– Child of $rootscope
– New child scope is created by build-in directive
(ng-repeat, ng-switch, ng-view and ng-include)
• Isolate scope: no inherits from parent.
Angular Scope Inheritance
Hides/shadows property issue
• Six data types that are primitives:
– Boolean
– Null
– Undefined
– Number
– String
– Symbol (new in ECMAScript 6)
• Change a primitive value defined on the parent
scope from inside the child scope.

Recommended for you

AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started

In this presentation, you will find everything need to get started with AngularJS. For more details, have a look at my blog (http://stephanebegaudeau.tumblr.com) or follow me on twitter (@sbegaudeau)

angularangularjsjavascript
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs

AngularJS is a JavaScript framework for building dynamic web applications. It augments HTML with custom attributes and directives to bind data and behaviors to the DOM. Key features include two-way data binding, reusable components, dependency injection, routing, and templating. AngularJS uses an MVC or MVVM pattern, with scopes providing the view model. The framework enhances HTML, encourages test-driven development, and makes single page apps possible.

angularjsintroductionhtml5
Angular Deep Directive
Angular Deep DirectiveAngular Deep Directive
Angular Deep Directive

The document discusses advanced AngularJS directives. It begins with an overview of directive configuration options like restrict, priority, terminal, template, and controller. It then covers advanced topics like isolate scope, transclusion, and the difference between compile and link functions. The document includes code samples and encourages the reader to experiment with directives through code samples on Plunker. It concludes by providing additional resources for learning more about directives.

directivejavascript meetupangularjs
childScope.aString === 'parent string'
childScope.anArray[1] === 20
childScope.anObject.property1 === 'parent prop1'
childScope.aFunction() === 'parent output'
childScope.aString = 'child string'
A new aString property is added to the childScope.
-> This new property hides/shadows the parentScope property with the same
name
childScope.anArray = [100, 555]
childScope.anObject = { name: 'Mark', country: 'USA' }
workarounds
• If you really want/need to use a primitive,
there are two workarounds:
– Use $parent.parentScopeProperty in the child
scope. This will prevent the child scope from
creating its own property.
– Define a function on the parent scope, and call it
from the child, passing the primitive value up to
the parent (not always possible)

Recommended for you

Custom AngularJS Directives
Custom AngularJS DirectivesCustom AngularJS Directives
Custom AngularJS Directives

Diving in AngularJS Custom Directives ocean. Short overview of the biggest subject of AngularJS Framework.

overviewangularangularjs
Step by Step - AngularJS
Step by Step - AngularJSStep by Step - AngularJS
Step by Step - AngularJS

On September 25th we hosted a webinar on “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 And more!

beginnerhow-toangularjs
AngularJS custom directive
AngularJS custom directiveAngularJS custom directive
AngularJS custom directive

This document discusses AngularJS custom directives. It begins by defining directives as markers that tell Angular's compiler how to attach behaviors to DOM elements. It then lists some built-in directives like ngBind and ngModel. It outlines conventions for writing custom directives, such as using camelCase and dash-delimited attributes. Finally, it provides examples of different directive types (elements, attributes, comments, classes) and best practices like prefixing directive names and restricting directives to elements only when possible.

directiveangularjsjavascript
Data binding
• Changes to the model are NOT automatically reflected in the view.
• Any changes the view are NOT automatically reflected in the model.
After the merge occurs:
Two way data binding
1. The template is compiled on the browser.
2. The compilation step produces a live view.
3. Any changes to the view are immediately reflected in the model,
4. and any changes in the model are propagated to the view.
$scope.$watch
• When you create a data binding from somewhere
in your view to a variable on the $scope object,
AngularJS creates a "watch" internally.
• A watch means that AngularJS watches changes
in the variable on the $scope object.
• Watches are created using the $scope.$watch()
• Each $watch be inserted into $watch list
$scope.$watch

Recommended for you

Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa...
Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa...Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa...
Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa...

AngularJS provides many built-in directives that can be used to manipulate the DOM, handle events, and more but there will be times when you need to write custom directives. How do you get started? Are directives really as scary as they look at first glance? In this session Dan Wahlin will provide a step-by-step look at creating custom AngularJS directives and show how to use templates, controllers, the link function, and many other features. You'll also see how custom directives can be used along with other AngularJS features such as $http interceptors and validation. By the end of the session you'll realize that directives aren't quite as scary as they first appear.

domdan wahlinangular js
Scope in AngularJs
Scope in AngularJsScope in AngularJs
Scope in AngularJs

This document discusses scopes in AngularJS. Scopes provide application state, expression evaluation context, and watch/propagate model changes. $rootScope is the global context, while $scope connects controllers and views. Scopes use prototypal inheritance like JavaScript, allowing child scopes to inherit properties from parents. Directive scopes can be isolated, transcluded to the parent scope, or inherit normally. Ng-repeat creates new child scopes each iteration. Scopes are created, register watchers, observe mutations, and are destroyed over their lifecycle.

framgiajavascriptangularjs
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS

This document provides an overview and introduction to single page application (SPA) frameworks using AngularJS. It discusses the rise of responsive SPAs and some of the challenges in building SPAs. It then introduces key AngularJS concepts like templates, directives, expressions, data binding, scopes, controllers and modules. It also includes a recap of JavaScript concepts like objects, functions and classes. Finally, it demonstrates basic AngularJS examples using directives, expressions, filters, controllers and scopes.

angularjs
$scope.$digest
• Use to checks if there are any changes to all the
variables watched by all the $scopes.
• If a watched variable has changed, a
corresponding listener function is called.
• This listener function does what it need to do:
• Example: changing an HTML text to reflect the
new value of the watched variable.
• => the $digest() function is what triggers the data
binding to update.
$digest loop
• Loop through $watch list and compare old vs new value:
– Hey $watch, what is your value?
• It is 9
– Alright, has it changed?
• No, sir.
– (nothing happens with this one, so it moves to the next)
– You, what is your value?
• It is Foo.
– Has it changed?
• Yes, it was Bar.
– (good, we have a DOM to be updated)
– This continues until every $watch has been checked.
• When the $digest loop finishes, the DOM makes the changes.
=> Dirty Checking
One more
Time
Baby!
Dirty checking
• if the loop runs more than 10 times, it will
throw an exception to prevent infinite loops
Dirty Checking

Recommended for you

AngularJS Compile Process
AngularJS Compile ProcessAngularJS Compile Process
AngularJS Compile Process

This document summarizes the process of compiling directives in AngularJS. It begins by describing how directives are defined with directive definition objects (DDOs). It then outlines the compilation process, which involves collecting all the directives on a node, executing their templates and compile functions, linking controllers and linking pre and post functions. The compilation process recurses through child nodes. Finally, it shows how $compile is used to bootstrap Angular on a page and kick off the compilation.

angularjs
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS Architecture

AngularJS uses a compile function to parse HTML into DOM elements and compile directives. The compile function sorts directives by priority and executes their compile and link functions to connect the scope to the DOM. It recursively compiles child elements. This allows directives to manipulate DOM elements and register behavior.

angularjs
Advanced AngularJS Concepts
Advanced AngularJS ConceptsAdvanced AngularJS Concepts
Advanced AngularJS Concepts

This document discusses AngularJS architectural advice and testing strategies. It recommends using isolate scope directives to avoid binding to functions directly and manipulating the DOM. It also covers accessibility, SEO, integration testing with Karma and Duck Angular, end-to-end testing with Protractor, and putting together a full testing stack with a web server, Selenium, Java, and Protractor prerequisites.

angularjskarmajavascript
$scope.$apply
• used to execute some code, and then
call $scope.$digest() after that.
• Called when an event is fire
AngularJs presentation
When angular doesn’t use $apply for us
• Native event that is not wrapped into $apply
call.
• Use directly jQuery.ajax()
=> Whenever possible, use AngularJS services
instead of native
Using $watch for our own stuff
• $watch(watchExpression, listener);
-> $watch will only shallow check the referenced value by default.
• $watch(watchExpression, listener, true);
-> When deep-watching an object, angular will follow all references to other
objects.
-> May be results in an infinite loop.
• $watchCollection(obj, listener);
-> deep-watching array.
• Dirty checking can be done with three strategies: By reference, by
collection contents, and by value
• ng-model does not do a deep watch

Recommended for you

Angular js
Angular jsAngular js
Angular js

AngularJS is an open-source JavaScript framework for building client-side web applications. It facilitates the creation of single-page applications using Model-View-Controller architecture. Key aspects of AngularJS include data binding, directives, dependency injection, services, filters and forms. It promotes declarative programming for templates and imperative code for controllers and logic. AngularJS makes it easier to write modular code through services and dependency injection. It also simplifies communication with backend servers via the $http service and $resource for RESTful APIs.

angularjs
AngularJs Crash Course
AngularJs Crash CourseAngularJs Crash Course
AngularJs Crash Course

An introduction to the complex single page web application framework known as AngularJs. An attempt to overview the high-level aspects of the framework, and to supply references for further exploration.

angularjsangularbeginner angularjs
AngularJS Scopes
AngularJS ScopesAngularJS Scopes
AngularJS Scopes

AngularJS scopes provide an execution context for expressions and allow for communication between controllers and views. Scopes are arranged hierarchically and mimic the DOM structure, with child scopes prototypically inheriting from parent scopes. Directives like ng-repeat and ng-controller create new child scopes, while others like ng-include use the parent scope. Scopes are created, register watchers, observe mutations during digest cycles, and are destroyed when no longer needed to clean up memory.

angularjs
AngularJs presentation
DI - Dependence Injection
• Dependency injection means giving an object
its instance variables. Really. That's it.
• Instead of having it construct them itself.
• Dependencies can be injected into objects by
many means (such as constructor injection or
setter injection)
DI in AngularJS
The Provider ($provide)
• Injectable things - services
• Services are defined by things called providers
• Providers are created by $provide service.
• The $provide service is responsible for telling
Angular how to create new services.

Recommended for you

Angular js
Angular jsAngular js
Angular js

- The document discusses AngularJS and single page applications. It provides an introduction and overview of key AngularJS concepts including modules, controllers, views, services, dependency injection, and filters. - Code samples and demos are referenced to illustrate concepts in more depth. Challenges with SEO and the benefits of TypeScript for adding type safety to JavaScript are also mentioned.

Angular js 1.0-fundamentals
Angular js 1.0-fundamentalsAngular js 1.0-fundamentals
Angular js 1.0-fundamentals

This document provides an overview of AngularJS fundamentals including controllers, services, directives, dependency injection, routing, forms, and testing. It discusses key AngularJS concepts like scopes, expressions, filters, and the digest loop. Sample code is presented to demonstrate modules, controllers, and directives. Various options for server communication, caching, debugging, localization, and animation are also covered. Guidelines for optimizing AngularJS applications are provided at the end.

angularjs
Angularjs
AngularjsAngularjs
Angularjs

AngularJS is a JavaScript MVC framework created by Google to build maintainable web applications. It was released in 2012 and focuses on HTML and MVC/MVVM design patterns. Key features include data binding, controllers, directives, expressions, forms, modules, scopes, dependency injection, filters and services.

#angularjs
Defining a provider
• $provide. provider(name, provider);
• $get : create a service – greeting service
Inject service
• Angular will call the greeting
provider's $get function in order to return a
new instance of the service.
Service in AngularJS
• Lazily instantiated – Angular only instantiates
a service when an application component
depends on it.
• Singletons – Each component dependent on a
service gets a reference to the single instance
generated by the service factory.
$provide.factory
• Short way to create Service.
• AngularJS is calling the exact same
code $provide.provider for us.

Recommended for you

AngularJS Beginners Workshop
AngularJS Beginners WorkshopAngularJS Beginners Workshop
AngularJS Beginners Workshop

Material I prepared for a beginner's workshop on AngularJS. Feel free to change it for your own use. I would appreciate it if you attributed the original to me.

angularjstrainingflydart
Angular js for Beginnners
Angular js for BeginnnersAngular js for Beginnners
Angular js for Beginnners

AngularJS is a JavaScript MVC framework that allows developers to create dynamic web applications. It uses HTML as the template language and allows two-way data binding between models and views. Some key features include directives, modules, controllers, services and filters. AngularJS applications can be unit tested and services can be injected for dependency injection. Routing in AngularJS allows single page applications without reloading the entire page.

javascriptangularjs
Integrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMSIntegrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMS

AngularJS can provide some of the benefits of a server-side templating system without sacrificing the speed and reliability of the campus CMS.

cmsuc san diegoangularjs
$provide.service
• $provide. service(name, constructor)
Common way
Provider vs Factory vs Service
1. app.provider('c', fn); => new fn(); fn.$get()
2. app.factory('a', fn); => fn() { return obj }
3. app.service('b', fn); => new fn()
Config & Run phases
angular.module('myModule', [])
. config(function(injectables){ // provider / $provide and $injector
// This is an example of config block.
// You can have as many of these as you want.
// You can only inject Providers (not instances)
// into config blocks.
})
. run(function(injectables) { // instance-injector
// This is an example of a run block.
// You can have as many of these as you want.
// You can only inject instances (not Providers) into run blocks
});

Recommended for you

Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetup

This document provides an overview of AngularJS, including its history, key features, and how it works. It originated at Google and was open-sourced in 2009. Some key features include two-way data binding, separation of model and view, and being unit testable. It uses MVC architecture with declarative coding. Core concepts covered include directives like ng-app, ng-model, expressions, scopes, controllers, views, filters, routing, and dependency injection.

drupalkolkataangularjs
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs

AngularJS is an open source JavaScript framework for building dynamic web applications. It enhances HTML with custom directives and bindings to enrich client-side web applications with reusable components. Key features include two-way data binding, reusable components, support for MVC/MVVM design patterns, end-to-end testing, cross-browser compatibility, and services. AngularJS allows developers to organize applications into modules and controllers to keep code clean and reusable.

angularjswebmvc
AngularJS in practice
AngularJS in practiceAngularJS in practice
AngularJS in practice

Quick introduction into AngularJS framework, Overview of bad and good practices Javascript developers follow when working with AngularJS.

javascriptweb developmentangularjs
The Injector ($injector)
• The injector is responsible for actually creating
instances of our services using the code we
provided via $provide
$injector
greetingProvider
$httpProvider
$routeProvider
I need “greeting” service
Create instance
“greeting” service instance
var greeting = $injector.get('greeting');
$injector
• Each AngularJS application has a single $injector that
gets created when the application first starts.
• You can inject services into any function that is
called with$injector.invoke. This includes:
– controller definition functions
– directive definition functions
– filter definition functions
– the $get methods of providers (aka
the factory definition functions)
AngularJs presentation
• Custom Directive.
• AngularJS bootstrap life cycle.

Recommended for you

Angular js
Angular jsAngular js
Angular js

AngularJS is a JavaScript framework for building web applications using MVC architecture. It separates an application into three main components: models, views, and controllers. Scopes provide the link between models and views by allowing views to watch models and propagate changes. AngularJS differs from jQuery in that it focuses on designing the architecture first before building the application and views. Key features include data binding, dependency injection, and directives like ng-repeat and ng-src to manipulate the DOM.

javascriptangularjs
Angular js
Angular jsAngular js
Angular js

This document provides an overview of AngularJS, including what it is, how it uses MVC architecture, data binding, views, controllers, models, modules, routing, and more. Some key points are: - AngularJS is an open-source JavaScript framework that uses MVC pattern for building dynamic web apps - It uses data binding so changes to models and data are automatically reflected in views - Views use directives like ng-repeat and ng-if to interact with models and controllers - Controllers contain business logic and models contain application data - Modules are used to separate an app into components and routing manages multiple views

angularjs
Angular js
Angular jsAngular js
Angular js

This document provides an overview of AngularJS, including what it is, how it uses MVC architecture, data binding, views, controllers, models, modules, and routing. AngularJS is an open-source JavaScript framework that uses MVC pattern and two-way data binding. It allows creating dynamic web applications using HTML as the template language and allows binding data and behavior to HTML.

More Related Content

What's hot

Use Node.js to create a REST API
Use Node.js to create a REST APIUse Node.js to create a REST API
Use Node.js to create a REST API
Fabien Vauchelles
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
WebStackAcademy
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js
async_io
 
Angular Advanced Routing
Angular Advanced RoutingAngular Advanced Routing
Angular Advanced Routing
Laurent Duveau
 
Angular Introduction By Surekha Gadkari
Angular Introduction By Surekha GadkariAngular Introduction By Surekha Gadkari
Angular Introduction By Surekha Gadkari
Surekha Gadkari
 
Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)
Postman
 
Angular
AngularAngular
Angular
Lilia Sfaxi
 
Nestjs MasterClass Slides
Nestjs MasterClass SlidesNestjs MasterClass Slides
Nestjs MasterClass Slides
Nir Kaufman
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
WebStackAcademy
 
MongoDB and Node.js
MongoDB and Node.jsMongoDB and Node.js
MongoDB and Node.js
Norberto Leite
 
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - Directives
WebStackAcademy
 
An Overview on Nuxt.js
An Overview on Nuxt.jsAn Overview on Nuxt.js
An Overview on Nuxt.js
Squash Apps Pvt Ltd
 
Angular modules in depth
Angular modules in depthAngular modules in depth
Angular modules in depth
Christoffer Noring
 
ES6 presentation
ES6 presentationES6 presentation
ES6 presentation
ritika1
 
Nuxt.JS Introdruction
Nuxt.JS IntrodructionNuxt.JS Introdruction
Nuxt.JS Introdruction
David Ličen
 
Angular
AngularAngular
Angular
khoado2002
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
ivpol
 
Angular 14.pptx
Angular 14.pptxAngular 14.pptx
Angular 14.pptx
MohaNedGhawar
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
Emprovise
 
Angular
AngularAngular

What's hot (20)

Use Node.js to create a REST API
Use Node.js to create a REST APIUse Node.js to create a REST API
Use Node.js to create a REST API
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js
 
Angular Advanced Routing
Angular Advanced RoutingAngular Advanced Routing
Angular Advanced Routing
 
Angular Introduction By Surekha Gadkari
Angular Introduction By Surekha GadkariAngular Introduction By Surekha Gadkari
Angular Introduction By Surekha Gadkari
 
Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)
 
Angular
AngularAngular
Angular
 
Nestjs MasterClass Slides
Nestjs MasterClass SlidesNestjs MasterClass Slides
Nestjs MasterClass Slides
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
 
MongoDB and Node.js
MongoDB and Node.jsMongoDB and Node.js
MongoDB and Node.js
 
Angular - Chapter 5 - Directives
 Angular - Chapter 5 - Directives Angular - Chapter 5 - Directives
Angular - Chapter 5 - Directives
 
An Overview on Nuxt.js
An Overview on Nuxt.jsAn Overview on Nuxt.js
An Overview on Nuxt.js
 
Angular modules in depth
Angular modules in depthAngular modules in depth
Angular modules in depth
 
ES6 presentation
ES6 presentationES6 presentation
ES6 presentation
 
Nuxt.JS Introdruction
Nuxt.JS IntrodructionNuxt.JS Introdruction
Nuxt.JS Introdruction
 
Angular
AngularAngular
Angular
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Angular 14.pptx
Angular 14.pptxAngular 14.pptx
Angular 14.pptx
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Angular
AngularAngular
Angular
 

Viewers also liked

AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example
Sergey Bolshchikov
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started
Stéphane Bégaudeau
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
Manish Shekhawat
 
Angular Deep Directive
Angular Deep DirectiveAngular Deep Directive
Angular Deep Directive
Henry Tao
 
Custom AngularJS Directives
Custom AngularJS DirectivesCustom AngularJS Directives
Custom AngularJS Directives
yprodev
 
Step by Step - AngularJS
Step by Step - AngularJSStep by Step - AngularJS
Step by Step - AngularJS
Infragistics
 
AngularJS custom directive
AngularJS custom directiveAngularJS custom directive
AngularJS custom directive
Nascenia IT
 
Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa...
Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa...Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa...
Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa...
FalafelSoftware
 
Scope in AngularJs
Scope in AngularJsScope in AngularJs
Scope in AngularJs
Thien To
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
Jussi Pohjolainen
 
AngularJS Compile Process
AngularJS Compile ProcessAngularJS Compile Process
AngularJS Compile Process
Eyal Vardi
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS Architecture
Eyal Vardi
 
Advanced AngularJS Concepts
Advanced AngularJS ConceptsAdvanced AngularJS Concepts
Advanced AngularJS Concepts
Kyle Hodgson
 

Viewers also liked (13)

AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
 
Angular Deep Directive
Angular Deep DirectiveAngular Deep Directive
Angular Deep Directive
 
Custom AngularJS Directives
Custom AngularJS DirectivesCustom AngularJS Directives
Custom AngularJS Directives
 
Step by Step - AngularJS
Step by Step - AngularJSStep by Step - AngularJS
Step by Step - AngularJS
 
AngularJS custom directive
AngularJS custom directiveAngularJS custom directive
AngularJS custom directive
 
Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa...
Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa...Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa...
Building Custom AngularJS Directives - A Step-by-Step Guide - Dan Wahlin | Fa...
 
Scope in AngularJs
Scope in AngularJsScope in AngularJs
Scope in AngularJs
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
AngularJS Compile Process
AngularJS Compile ProcessAngularJS Compile Process
AngularJS Compile Process
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS Architecture
 
Advanced AngularJS Concepts
Advanced AngularJS ConceptsAdvanced AngularJS Concepts
Advanced AngularJS Concepts
 

Similar to AngularJs presentation

Angular js
Angular jsAngular js
Angular js
Baldeep Sohal
 
AngularJs Crash Course
AngularJs Crash CourseAngularJs Crash Course
AngularJs Crash Course
Keith Bloomfield
 
AngularJS Scopes
AngularJS ScopesAngularJS Scopes
AngularJS Scopes
Mohamed Elkhodary
 
Angular js
Angular jsAngular js
Angular js
Mauro Servienti
 
Angular js 1.0-fundamentals
Angular js 1.0-fundamentalsAngular js 1.0-fundamentals
Angular js 1.0-fundamentals
Venkatesh Narayanan
 
Angularjs
AngularjsAngularjs
Angularjs
Sabin Tamrakar
 
AngularJS Beginners Workshop
AngularJS Beginners WorkshopAngularJS Beginners Workshop
AngularJS Beginners Workshop
Sathish VJ
 
Angular js for Beginnners
Angular js for BeginnnersAngular js for Beginnners
Angular js for Beginnners
Santosh Kumar Kar
 
Integrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMSIntegrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMS
Tom Borger
 
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetup
Goutam Dey
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
Gaurav Agrawal
 
AngularJS in practice
AngularJS in practiceAngularJS in practice
AngularJS in practice
Eugene Fidelin
 
Angular js
Angular jsAngular js
Angular js
Larry Ball
 
Angular js
Angular jsAngular js
Angular js
Hritesh Saha
 
Angular js
Angular jsAngular js
Angular js
yogi_solanki
 
Angular js meetup
Angular js meetupAngular js meetup
Angular js meetup
Pierre-Yves Gicquel
 
angularjsmeetup-150303044616-conversion-gate01
angularjsmeetup-150303044616-conversion-gate01angularjsmeetup-150303044616-conversion-gate01
angularjsmeetup-150303044616-conversion-gate01
Teo E
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
Anuradha Bandara
 
Workshop 14: AngularJS Parte III
Workshop 14: AngularJS Parte IIIWorkshop 14: AngularJS Parte III
Workshop 14: AngularJS Parte III
Visual Engineering
 
Coffee@DBG - Exploring Angular JS
Coffee@DBG - Exploring Angular JSCoffee@DBG - Exploring Angular JS
Coffee@DBG - Exploring Angular JS
Deepu S Nath
 

Similar to AngularJs presentation (20)

Angular js
Angular jsAngular js
Angular js
 
AngularJs Crash Course
AngularJs Crash CourseAngularJs Crash Course
AngularJs Crash Course
 
AngularJS Scopes
AngularJS ScopesAngularJS Scopes
AngularJS Scopes
 
Angular js
Angular jsAngular js
Angular js
 
Angular js 1.0-fundamentals
Angular js 1.0-fundamentalsAngular js 1.0-fundamentals
Angular js 1.0-fundamentals
 
Angularjs
AngularjsAngularjs
Angularjs
 
AngularJS Beginners Workshop
AngularJS Beginners WorkshopAngularJS Beginners Workshop
AngularJS Beginners Workshop
 
Angular js for Beginnners
Angular js for BeginnnersAngular js for Beginnners
Angular js for Beginnners
 
Integrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMSIntegrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMS
 
Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetup
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
 
AngularJS in practice
AngularJS in practiceAngularJS in practice
AngularJS in practice
 
Angular js
Angular jsAngular js
Angular js
 
Angular js
Angular jsAngular js
Angular js
 
Angular js
Angular jsAngular js
Angular js
 
Angular js meetup
Angular js meetupAngular js meetup
Angular js meetup
 
angularjsmeetup-150303044616-conversion-gate01
angularjsmeetup-150303044616-conversion-gate01angularjsmeetup-150303044616-conversion-gate01
angularjsmeetup-150303044616-conversion-gate01
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
 
Workshop 14: AngularJS Parte III
Workshop 14: AngularJS Parte IIIWorkshop 14: AngularJS Parte III
Workshop 14: AngularJS Parte III
 
Coffee@DBG - Exploring Angular JS
Coffee@DBG - Exploring Angular JSCoffee@DBG - Exploring Angular JS
Coffee@DBG - Exploring Angular JS
 

Recently uploaded

20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
Matthew Sinclair
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
RaminGhanbari2
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
rajancomputerfbd
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
Adam Dunkels
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
huseindihon
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
UiPathCommunity
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
ScyllaDB
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
welrejdoall
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
Andrey Yasko
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
Stephanie Beckett
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
Larry Smarr
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
Enterprise Wired
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
Awais Yaseen
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 

Recently uploaded (20)

20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 

AngularJs presentation

  • 2. • What is AngularJS • AngularJS main components – View / Controller / Module / Scope • Scope Inheritance. • Two way data binding – $watch / $digest / $apply – Dirty Checking • DI - Dependence Injection • $provider vs $factory vs $service
  • 3. What is AngularJS • Javascript Front-end Framework (100% Javascript & 100% client side) • For building dynamic web apps. • Angular is what HTML would have been, had it been designed for applications. • HTML is a great declarative language for static documents. • But It does not contain much in the way of creating applications.
  • 4. • It lets you use HTML as template language. • It lets you extend HTML’s syntax to express your application’s components clearly and succinctly. • Angular's data binding and dependency injection eliminate much of the code you would otherwise have to write • MVC design parttern to organize codes.
  • 10. Directive • AngularJs is what HTML could have been if it had been designed for web application. • HTML is a markup language for describing web document.
  • 11. Directive • A directive is a maker on a DOM element that tells Angular to run or reference some JS code to: – Attach a specified behaviors to that DOM. – Transform the DOM on the fly. <map id="map_canvas" x="46.8765" y="-3.32910"></map>
  • 13. Expression • Allow you to insert dynamic values into your html. I am number {{0 + 1}} -> I am number 1 {{"hello" + " you"}} -> hello you {{“Hi," + user.name}} -> Hi, Tom
  • 14. Modules • A module is a collection of services, directives, controllers, filters, and configuration information • Where we write pieces of our angular application. • Makes our code more maintainable, testable and readable.
  • 16. Controller • Controller is a JavaScript function. • Controller contains business logic behind the application to decorate the scope with functions and data. • The ngController directive specifies a Controller class.
  • 19. Scope • scope is an object that refers to the application model. • Scope is the glue between application controller and the view. • Scope provide $watch to observe model mutations.
  • 26. Angular Scope Inheritance • In AngularJS, a child scope normally prototypically inherits from its parent scope • Child scope: – scope of child controller – Child of $rootscope – New child scope is created by build-in directive (ng-repeat, ng-switch, ng-view and ng-include) • Isolate scope: no inherits from parent.
  • 28. Hides/shadows property issue • Six data types that are primitives: – Boolean – Null – Undefined – Number – String – Symbol (new in ECMAScript 6) • Change a primitive value defined on the parent scope from inside the child scope.
  • 29. childScope.aString === 'parent string' childScope.anArray[1] === 20 childScope.anObject.property1 === 'parent prop1' childScope.aFunction() === 'parent output'
  • 30. childScope.aString = 'child string' A new aString property is added to the childScope. -> This new property hides/shadows the parentScope property with the same name
  • 31. childScope.anArray = [100, 555] childScope.anObject = { name: 'Mark', country: 'USA' }
  • 32. workarounds • If you really want/need to use a primitive, there are two workarounds: – Use $parent.parentScopeProperty in the child scope. This will prevent the child scope from creating its own property. – Define a function on the parent scope, and call it from the child, passing the primitive value up to the parent (not always possible)
  • 33. Data binding • Changes to the model are NOT automatically reflected in the view. • Any changes the view are NOT automatically reflected in the model. After the merge occurs:
  • 34. Two way data binding 1. The template is compiled on the browser. 2. The compilation step produces a live view. 3. Any changes to the view are immediately reflected in the model, 4. and any changes in the model are propagated to the view.
  • 35. $scope.$watch • When you create a data binding from somewhere in your view to a variable on the $scope object, AngularJS creates a "watch" internally. • A watch means that AngularJS watches changes in the variable on the $scope object. • Watches are created using the $scope.$watch() • Each $watch be inserted into $watch list
  • 37. $scope.$digest • Use to checks if there are any changes to all the variables watched by all the $scopes. • If a watched variable has changed, a corresponding listener function is called. • This listener function does what it need to do: • Example: changing an HTML text to reflect the new value of the watched variable. • => the $digest() function is what triggers the data binding to update.
  • 38. $digest loop • Loop through $watch list and compare old vs new value: – Hey $watch, what is your value? • It is 9 – Alright, has it changed? • No, sir. – (nothing happens with this one, so it moves to the next) – You, what is your value? • It is Foo. – Has it changed? • Yes, it was Bar. – (good, we have a DOM to be updated) – This continues until every $watch has been checked. • When the $digest loop finishes, the DOM makes the changes. => Dirty Checking One more Time Baby!
  • 39. Dirty checking • if the loop runs more than 10 times, it will throw an exception to prevent infinite loops
  • 41. $scope.$apply • used to execute some code, and then call $scope.$digest() after that. • Called when an event is fire
  • 43. When angular doesn’t use $apply for us • Native event that is not wrapped into $apply call. • Use directly jQuery.ajax() => Whenever possible, use AngularJS services instead of native
  • 44. Using $watch for our own stuff • $watch(watchExpression, listener); -> $watch will only shallow check the referenced value by default. • $watch(watchExpression, listener, true); -> When deep-watching an object, angular will follow all references to other objects. -> May be results in an infinite loop. • $watchCollection(obj, listener); -> deep-watching array. • Dirty checking can be done with three strategies: By reference, by collection contents, and by value • ng-model does not do a deep watch
  • 46. DI - Dependence Injection • Dependency injection means giving an object its instance variables. Really. That's it. • Instead of having it construct them itself. • Dependencies can be injected into objects by many means (such as constructor injection or setter injection)
  • 48. The Provider ($provide) • Injectable things - services • Services are defined by things called providers • Providers are created by $provide service. • The $provide service is responsible for telling Angular how to create new services.
  • 49. Defining a provider • $provide. provider(name, provider); • $get : create a service – greeting service
  • 50. Inject service • Angular will call the greeting provider's $get function in order to return a new instance of the service.
  • 51. Service in AngularJS • Lazily instantiated – Angular only instantiates a service when an application component depends on it. • Singletons – Each component dependent on a service gets a reference to the single instance generated by the service factory.
  • 52. $provide.factory • Short way to create Service. • AngularJS is calling the exact same code $provide.provider for us.
  • 55. Provider vs Factory vs Service 1. app.provider('c', fn); => new fn(); fn.$get() 2. app.factory('a', fn); => fn() { return obj } 3. app.service('b', fn); => new fn()
  • 56. Config & Run phases angular.module('myModule', []) . config(function(injectables){ // provider / $provide and $injector // This is an example of config block. // You can have as many of these as you want. // You can only inject Providers (not instances) // into config blocks. }) . run(function(injectables) { // instance-injector // This is an example of a run block. // You can have as many of these as you want. // You can only inject instances (not Providers) into run blocks });
  • 57. The Injector ($injector) • The injector is responsible for actually creating instances of our services using the code we provided via $provide $injector greetingProvider $httpProvider $routeProvider I need “greeting” service Create instance “greeting” service instance var greeting = $injector.get('greeting');
  • 58. $injector • Each AngularJS application has a single $injector that gets created when the application first starts. • You can inject services into any function that is called with$injector.invoke. This includes: – controller definition functions – directive definition functions – filter definition functions – the $get methods of providers (aka the factory definition functions)
  • 60. • Custom Directive. • AngularJS bootstrap life cycle.

Editor's Notes

  1. https://github.com/angular/angular.js/wiki/Understanding-Scopes http://jsfiddle.net/5qjLd/
  2. Example
  3. Example http://tech.small-improvements.com/2014/06/11/deep-watching-circular-data-structures-in-angular/
  4. http://www.jamesshore.com/Blog/Dependency-Injection-Demystified.html