SlideShare a Scribd company logo
www.edureka.co/angular-js
View AngularJS course details at www.edureka.co/angular-js
For Queries:
Post on Twitter @edurekaIN: #askEdureka
Post on Facebook /edurekaIN
For more details please contact us:
US : 1800 275 9730 (toll free)
INDIA : +91 88808 62004
Email us : sales@edureka.co
Animation And Testing In Angular JS
Slide 2 www.edureka.co/angular-jsSlide 2
Objectives
At the end of this module, you will be able to understand:
Two Way Data Binding
AngularUI for User Interface
ngAnimate for Animation
Testing in AngularJS
Slide 3 www.edureka.co/angular-jsSlide 3
Controllers in AngularJS define the workflow presentation logic
A JavaScript object
Created by a standard JavaScript object constructor
Attached to the view with ng-controller
Controllers can be defined in the application as shown
<div ng-controller=“MyController">
<body ng-controller=“MyController">
Controllers
Defining Controller
Using Controller in application
var myApp = angular.module('myApp',[]);
myApp.controller(‘MyController'.......
Slide 4 www.edureka.co/angular-jsSlide 4
Injected as an argument to the controller function
Holds the model data required by the view
Binds data to the view using AngularJS two way data binding
Represented by $scope in the controller function and links the controller to the view
Figure shown is representation of scope
app.controller(‘MyController', ['$scope',
function($scope) {
…………………..
]};
}]);
Scopes
Slide 5 www.edureka.co/angular-jsSlide 5
MODEL
AngularJS is a model driven application
A Model encapsulates the application data
Any change in the state, provides appropriate notifications to the controller and views
On notification views updates the output display of the application
Updating of view happens automatically with data bindings
TEMPLATE
Represents the model in the view and user interactions with application
Model and Template
Slide 6 www.edureka.co/angular-jsSlide 6Slide 6Slide 6
Putting Everything Together
How to bring relation between Model,
Controller and Templates in the
application?
Slide 7 www.edureka.co/angular-jsSlide 7Slide 7Slide 7
app.controller('ProductsController', ['$scope', function($scope) {
$scope.product = {
id: 1,
name: 'Smart Phones‘,
type: ‘Mobile‘,
stores: [
{ id: 1, name: 'Samsung Galaxy', quantity: 5},
{ id: 2, name: 'Nokia', quantity: 3},
{ id: 3, name: 'HTC', quantity: 6}
]
};
}]);
Controller Scope Injection
Model
Controller Structure
Slide 8 www.edureka.co/angular-jsSlide 8Slide 8Slide 8
<div ng-controller="ProductController">
Id: <span ng-bind="product.id"></span>
<br/>
Name:<input type="text" ng-model="product.name" />
<br/>
Category: <input type="text" ng-model="product.type" />
</div>
Controller
AngularJS
Binding
Model
Binds form
control to
property
Model
Attribute
Two Way Data Binding
Slide 9 www.edureka.co/angular-js
AngularUI for User Interface
In normal jQuery application, we will be including bootstrap js files to access the bootstrap functionalities like modal,
accordion, datepicker, etc.,
We will be doing dom traversing to bind the event with dom element in jQuery.
Instead of doing DOM traversing, we will be creating custom directives in AngularJS to bind the events.
Angular UI will be having special set of directives to achieve bootstrap functionalities in angularJS app.
Slide 10 www.edureka.co/angular-js
How to use AngularUI
Download required javascript, css files and include those in main html.
In angular module declare a ui.bootstrap as a dependency to your angular App.
e.g : - angular.module( ‘demo’ , ['ui.bootstrap'] );
 ui.bootstrap module will be having all bootstrap functionalities as directives and services. Once it is injected into our
application, we can access all the bootstrap modules.
Slide 11 www.edureka.co/angular-js
ngAnimate for Animation
The ngAnimate module provides support for CSS-based animations as well as JavaScript-based animations.
Animations are not available unless you include the ngAnimate module as a dependency within your
application.
ngAnimate can be used with various directives like ngRepeat, ngView, ngInclude, ngIf, ngMessage etc.
Slide 12 www.edureka.co/angular-js
How to use ngAnimate
 Download and include ng-animate js file to main html.
 Add ngAnimate as a dependency to angular application.
e.g : angular.module( ‘demo’ , ['ngAnimate'] );
Slide 13 www.edureka.co/angular-js
How it works
 Once ngAnimate injected we can use animations by using CSS or JavaScript.
 For both CSS and JS animations the sole requirement is to have a matching CSS class that exists both in the
registered animation and within the HTML element that the animation will be triggered on.
 ngAnimate is supported in following modules : ngRepeat, ngShow, ngHide, ngIf, ng-view etc.
 CSS based animation :
 CSS-based animations require no JavaScript code. By using a CSS class that we reference between our HTML
and CSS code we can create an animation that will be picked up by Angular when an the underlying directive
performs an operation.
 JavaScript based animation :
 ngAnimate also allows for animations to be consumed by JavaScript code. By making use of the
module.animation() module function we can register the animation.
Slide 14 www.edureka.co/angular-js
Edureka ngAnimate Blog
Visit: http://www.edureka.co/blog/animating-angular-apps-with-nganimate
Slide 15 www.edureka.co/angular-jsSlide 15
Unit Testing
Slide 16 www.edureka.co/angular-jsSlide 16
Manual Testing
Traditionally developers manually test their application
Manual testing is less efficient
Very difficult to track the test result
Very difficult to test all the pieces of code
Very difficult to test the integration of two ore more functions
Differs from one developer to another developer
Slide 17 www.edureka.co/angular-jsSlide 17
Unit Testing With Angular.js
Add Test
Watch
Test Fail
Watch
Code
Run Test
Refactor
Slide 18 www.edureka.co/angular-js
Course Topics
 Module 1
» Introduction to JavaScript MVC Framework
and AngularJS
 Module 2
» Dependency Injection and Controllers
 Module 3
» Route, Directive and Filters
 Module 4
» Creating Custom Directives and Filters
 Module 5
» Third-party AngularJS Modules and Testing
Angular
 Module 6
» AngularJS with Node.js, Yeoman and Rest
Exposure
 Module 7
» Project Discussion
Slide 19 www.edureka.co/angular-js
LIVE Online Class
Class Recording in LMS
24/7 Post Class Support
Module Wise Quiz
Project Work
Verifiable Certificate
Course Features
Slide 20 www.edureka.co/angular-js
Questions
Slide 21 www.edureka.co/angular-js

More Related Content

PDF
Webinar on Angular JS titled 'Develop Responsive Single Page Application'
PPTX
Live Demo : Trending Angular JS Featues
PDF
AngularJS : Superheroic JavaScript MVW Framework
PDF
Angular JS - Develop Responsive Single Page Application
PDF
Deep Dive into AngularJS Javascript Framework
PDF
Getting Started With AngularJS
PDF
AngularJS : Superheroic Javascript MVW Framework
PDF
Learn How to Animate your Android App
Webinar on Angular JS titled 'Develop Responsive Single Page Application'
Live Demo : Trending Angular JS Featues
AngularJS : Superheroic JavaScript MVW Framework
Angular JS - Develop Responsive Single Page Application
Deep Dive into AngularJS Javascript Framework
Getting Started With AngularJS
AngularJS : Superheroic Javascript MVW Framework
Learn How to Animate your Android App

What's hot (20)

PDF
AngularJS for Beginners
PDF
Implementing Web Services In Java
PDF
Day In A Life Of A Node.js Developer
PDF
Develop Mobile App Using Android Lollipop
PPTX
Anjular js
PDF
Using Android 5.0 Lollipop
PDF
Android development 1july
PDF
Webinar: Microsoft .NET Framework : An IntelliSense Way of Web Development
PPTX
Introduction to Android Programming
PDF
iOS Development Using Swift 2
PDF
9 reasons why angular js web development should be your choice in 2020
PDF
Introduction to Android Development
PDF
Webinar: Front End Web Development - Trendy Web Designs Using HTML5
PPTX
Angular 5,6,7
PDF
Top 8 angular js framework for web development
PDF
An introduction to AngularJS
PPTX
Introduction to AngularJS Framework
PDF
How to optimize the performance of vue js large application structure
PDF
Angular material tutorial
PPTX
Slides of webinar Kendo UI and Knockout.js
AngularJS for Beginners
Implementing Web Services In Java
Day In A Life Of A Node.js Developer
Develop Mobile App Using Android Lollipop
Anjular js
Using Android 5.0 Lollipop
Android development 1july
Webinar: Microsoft .NET Framework : An IntelliSense Way of Web Development
Introduction to Android Programming
iOS Development Using Swift 2
9 reasons why angular js web development should be your choice in 2020
Introduction to Android Development
Webinar: Front End Web Development - Trendy Web Designs Using HTML5
Angular 5,6,7
Top 8 angular js framework for web development
An introduction to AngularJS
Introduction to AngularJS Framework
How to optimize the performance of vue js large application structure
Angular material tutorial
Slides of webinar Kendo UI and Knockout.js
Ad

Similar to Animation And Testing In AngularJS (20)

PDF
One Weekend With AngularJS
PPTX
AgularJS basics- angular directives and controllers
PPSX
PDF
Getting Started with AngularJS
PPTX
Training On Angular Js
PPTX
GDG Atlanta - Angular.js Demo and Workshop
PDF
Formation angular js/Ionic
PDF
Angular js interview question answer for fresher
PPTX
Angular js
PDF
AngularJS By Vipin
PPTX
18CSC311J WEB DESIGN AND DEVELOPMENT UNIT-2
PPT
introduction to Angularjs basics
PPTX
Angular Javascript Tutorial with command
PPTX
Angular - Beginner
PPTX
Building a dashboard using AngularJS
DOCX
angularjs_tutorial.docx
PPT
AngularJS for Legacy Apps
PPTX
Angular Js Get Started - Complete Course
PPTX
Kalp Corporate Angular Js Tutorials
PPTX
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
One Weekend With AngularJS
AgularJS basics- angular directives and controllers
Getting Started with AngularJS
Training On Angular Js
GDG Atlanta - Angular.js Demo and Workshop
Formation angular js/Ionic
Angular js interview question answer for fresher
Angular js
AngularJS By Vipin
18CSC311J WEB DESIGN AND DEVELOPMENT UNIT-2
introduction to Angularjs basics
Angular Javascript Tutorial with command
Angular - Beginner
Building a dashboard using AngularJS
angularjs_tutorial.docx
AngularJS for Legacy Apps
Angular Js Get Started - Complete Course
Kalp Corporate Angular Js Tutorials
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
Ad

More from Edureka! (20)

PDF
What to learn during the 21 days Lockdown | Edureka
PDF
Top 10 Dying Programming Languages in 2020 | Edureka
PDF
Top 5 Trending Business Intelligence Tools | Edureka
PDF
Tableau Tutorial for Data Science | Edureka
PDF
Python Programming Tutorial | Edureka
PDF
Top 5 PMP Certifications | Edureka
PDF
Top Maven Interview Questions in 2020 | Edureka
PDF
Linux Mint Tutorial | Edureka
PDF
How to Deploy Java Web App in AWS| Edureka
PDF
Importance of Digital Marketing | Edureka
PDF
RPA in 2020 | Edureka
PDF
Email Notifications in Jenkins | Edureka
PDF
EA Algorithm in Machine Learning | Edureka
PDF
Cognitive AI Tutorial | Edureka
PDF
AWS Cloud Practitioner Tutorial | Edureka
PDF
Blue Prism Top Interview Questions | Edureka
PDF
Big Data on AWS Tutorial | Edureka
PDF
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
PDF
Kubernetes Installation on Ubuntu | Edureka
PDF
Introduction to DevOps | Edureka
What to learn during the 21 days Lockdown | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
Tableau Tutorial for Data Science | Edureka
Python Programming Tutorial | Edureka
Top 5 PMP Certifications | Edureka
Top Maven Interview Questions in 2020 | Edureka
Linux Mint Tutorial | Edureka
How to Deploy Java Web App in AWS| Edureka
Importance of Digital Marketing | Edureka
RPA in 2020 | Edureka
Email Notifications in Jenkins | Edureka
EA Algorithm in Machine Learning | Edureka
Cognitive AI Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
Blue Prism Top Interview Questions | Edureka
Big Data on AWS Tutorial | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Kubernetes Installation on Ubuntu | Edureka
Introduction to DevOps | Edureka

Animation And Testing In AngularJS

  • 1. www.edureka.co/angular-js View AngularJS course details at www.edureka.co/angular-js For Queries: Post on Twitter @edurekaIN: #askEdureka Post on Facebook /edurekaIN For more details please contact us: US : 1800 275 9730 (toll free) INDIA : +91 88808 62004 Email us : [email protected] Animation And Testing In Angular JS
  • 2. Slide 2 www.edureka.co/angular-jsSlide 2 Objectives At the end of this module, you will be able to understand: Two Way Data Binding AngularUI for User Interface ngAnimate for Animation Testing in AngularJS
  • 3. Slide 3 www.edureka.co/angular-jsSlide 3 Controllers in AngularJS define the workflow presentation logic A JavaScript object Created by a standard JavaScript object constructor Attached to the view with ng-controller Controllers can be defined in the application as shown <div ng-controller=“MyController"> <body ng-controller=“MyController"> Controllers Defining Controller Using Controller in application var myApp = angular.module('myApp',[]); myApp.controller(‘MyController'.......
  • 4. Slide 4 www.edureka.co/angular-jsSlide 4 Injected as an argument to the controller function Holds the model data required by the view Binds data to the view using AngularJS two way data binding Represented by $scope in the controller function and links the controller to the view Figure shown is representation of scope app.controller(‘MyController', ['$scope', function($scope) { ………………….. ]}; }]); Scopes
  • 5. Slide 5 www.edureka.co/angular-jsSlide 5 MODEL AngularJS is a model driven application A Model encapsulates the application data Any change in the state, provides appropriate notifications to the controller and views On notification views updates the output display of the application Updating of view happens automatically with data bindings TEMPLATE Represents the model in the view and user interactions with application Model and Template
  • 6. Slide 6 www.edureka.co/angular-jsSlide 6Slide 6Slide 6 Putting Everything Together How to bring relation between Model, Controller and Templates in the application?
  • 7. Slide 7 www.edureka.co/angular-jsSlide 7Slide 7Slide 7 app.controller('ProductsController', ['$scope', function($scope) { $scope.product = { id: 1, name: 'Smart Phones‘, type: ‘Mobile‘, stores: [ { id: 1, name: 'Samsung Galaxy', quantity: 5}, { id: 2, name: 'Nokia', quantity: 3}, { id: 3, name: 'HTC', quantity: 6} ] }; }]); Controller Scope Injection Model Controller Structure
  • 8. Slide 8 www.edureka.co/angular-jsSlide 8Slide 8Slide 8 <div ng-controller="ProductController"> Id: <span ng-bind="product.id"></span> <br/> Name:<input type="text" ng-model="product.name" /> <br/> Category: <input type="text" ng-model="product.type" /> </div> Controller AngularJS Binding Model Binds form control to property Model Attribute Two Way Data Binding
  • 9. Slide 9 www.edureka.co/angular-js AngularUI for User Interface In normal jQuery application, we will be including bootstrap js files to access the bootstrap functionalities like modal, accordion, datepicker, etc., We will be doing dom traversing to bind the event with dom element in jQuery. Instead of doing DOM traversing, we will be creating custom directives in AngularJS to bind the events. Angular UI will be having special set of directives to achieve bootstrap functionalities in angularJS app.
  • 10. Slide 10 www.edureka.co/angular-js How to use AngularUI Download required javascript, css files and include those in main html. In angular module declare a ui.bootstrap as a dependency to your angular App. e.g : - angular.module( ‘demo’ , ['ui.bootstrap'] );  ui.bootstrap module will be having all bootstrap functionalities as directives and services. Once it is injected into our application, we can access all the bootstrap modules.
  • 11. Slide 11 www.edureka.co/angular-js ngAnimate for Animation The ngAnimate module provides support for CSS-based animations as well as JavaScript-based animations. Animations are not available unless you include the ngAnimate module as a dependency within your application. ngAnimate can be used with various directives like ngRepeat, ngView, ngInclude, ngIf, ngMessage etc.
  • 12. Slide 12 www.edureka.co/angular-js How to use ngAnimate  Download and include ng-animate js file to main html.  Add ngAnimate as a dependency to angular application. e.g : angular.module( ‘demo’ , ['ngAnimate'] );
  • 13. Slide 13 www.edureka.co/angular-js How it works  Once ngAnimate injected we can use animations by using CSS or JavaScript.  For both CSS and JS animations the sole requirement is to have a matching CSS class that exists both in the registered animation and within the HTML element that the animation will be triggered on.  ngAnimate is supported in following modules : ngRepeat, ngShow, ngHide, ngIf, ng-view etc.  CSS based animation :  CSS-based animations require no JavaScript code. By using a CSS class that we reference between our HTML and CSS code we can create an animation that will be picked up by Angular when an the underlying directive performs an operation.  JavaScript based animation :  ngAnimate also allows for animations to be consumed by JavaScript code. By making use of the module.animation() module function we can register the animation.
  • 14. Slide 14 www.edureka.co/angular-js Edureka ngAnimate Blog Visit: http://www.edureka.co/blog/animating-angular-apps-with-nganimate
  • 16. Slide 16 www.edureka.co/angular-jsSlide 16 Manual Testing Traditionally developers manually test their application Manual testing is less efficient Very difficult to track the test result Very difficult to test all the pieces of code Very difficult to test the integration of two ore more functions Differs from one developer to another developer
  • 17. Slide 17 www.edureka.co/angular-jsSlide 17 Unit Testing With Angular.js Add Test Watch Test Fail Watch Code Run Test Refactor
  • 18. Slide 18 www.edureka.co/angular-js Course Topics  Module 1 » Introduction to JavaScript MVC Framework and AngularJS  Module 2 » Dependency Injection and Controllers  Module 3 » Route, Directive and Filters  Module 4 » Creating Custom Directives and Filters  Module 5 » Third-party AngularJS Modules and Testing Angular  Module 6 » AngularJS with Node.js, Yeoman and Rest Exposure  Module 7 » Project Discussion
  • 19. Slide 19 www.edureka.co/angular-js LIVE Online Class Class Recording in LMS 24/7 Post Class Support Module Wise Quiz Project Work Verifiable Certificate Course Features