SlideShare a Scribd company logo
1 of 21
Download to read offline
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

What's hot

AngularJS for Beginners
AngularJS for BeginnersAngularJS for Beginners
AngularJS for BeginnersEdureka!
 
Implementing Web Services In Java
Implementing Web Services In JavaImplementing Web Services In Java
Implementing Web Services In JavaEdureka!
 
Day In A Life Of A Node.js Developer
Day In A Life Of A Node.js DeveloperDay In A Life Of A Node.js Developer
Day In A Life Of A Node.js DeveloperEdureka!
 
Develop Mobile App Using Android Lollipop
Develop Mobile App Using Android LollipopDevelop Mobile App Using Android Lollipop
Develop Mobile App Using Android LollipopEdureka!
 
Using Android 5.0 Lollipop
Using Android 5.0 LollipopUsing Android 5.0 Lollipop
Using Android 5.0 LollipopEdureka!
 
Android development 1july
Android development 1julyAndroid development 1july
Android development 1julyEdureka!
 
Webinar: Microsoft .NET Framework : An IntelliSense Way of Web Development
Webinar: Microsoft .NET Framework : An IntelliSense Way of Web DevelopmentWebinar: Microsoft .NET Framework : An IntelliSense Way of Web Development
Webinar: Microsoft .NET Framework : An IntelliSense Way of Web DevelopmentEdureka!
 
Introduction to Android Programming
Introduction to Android ProgrammingIntroduction to Android Programming
Introduction to Android ProgrammingRaveendra R
 
iOS Development Using Swift 2
iOS Development Using Swift 2iOS Development Using Swift 2
iOS Development Using Swift 2Edureka!
 
9 reasons why angular js web development should be your choice in 2020
9 reasons why angular js web development should be your choice in 20209 reasons why angular js web development should be your choice in 2020
9 reasons why angular js web development should be your choice in 2020Biztech Consulting & Solutions
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android DevelopmentEdureka!
 
Webinar: Front End Web Development - Trendy Web Designs Using HTML5
Webinar: Front End Web Development - Trendy Web Designs Using HTML5Webinar: Front End Web Development - Trendy Web Designs Using HTML5
Webinar: Front End Web Development - Trendy Web Designs Using HTML5Edureka!
 
Top 8 angular js framework for web development
Top 8 angular js framework for web developmentTop 8 angular js framework for web development
Top 8 angular js framework for web developmentMobMaxime
 
An introduction to AngularJS
An introduction to AngularJSAn introduction to AngularJS
An introduction to AngularJSYogesh singh
 
Introduction to AngularJS Framework
Introduction to AngularJS FrameworkIntroduction to AngularJS Framework
Introduction to AngularJS FrameworkRaveendra R
 
How to optimize the performance of vue js large application structure
How to optimize the performance of vue js large application structure How to optimize the performance of vue js large application structure
How to optimize the performance of vue js large application structure Katy Slemon
 
Angular material tutorial
Angular material tutorialAngular material tutorial
Angular material tutorialHarikaReddy115
 
Slides of webinar Kendo UI and Knockout.js
Slides of webinar Kendo UI and Knockout.jsSlides of webinar Kendo UI and Knockout.js
Slides of webinar Kendo UI and Knockout.jsDhananjay Kumar
 

What's hot (20)

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

Similar to Animation And Testing In AngularJS

One Weekend With AngularJS
One Weekend With AngularJSOne Weekend With AngularJS
One Weekend With AngularJSYashobanta Bai
 
Getting Started with AngularJS
Getting Started with AngularJSGetting Started with AngularJS
Getting Started with AngularJSEdureka!
 
GDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and WorkshopGDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and WorkshopDrew Morris
 
Formation angular js/Ionic
Formation angular js/IonicFormation angular js/Ionic
Formation angular js/IonicHana Amiri
 
Angular js interview question answer for fresher
Angular js interview question answer for fresherAngular js interview question answer for fresher
Angular js interview question answer for fresherRavi Bhadauria
 
introduction to Angularjs basics
introduction to Angularjs basicsintroduction to Angularjs basics
introduction to Angularjs basicsRavindra K
 
Building a dashboard using AngularJS
Building a dashboard using AngularJSBuilding a dashboard using AngularJS
Building a dashboard using AngularJSRajthilakMCA
 
angularjs_tutorial.docx
angularjs_tutorial.docxangularjs_tutorial.docx
angularjs_tutorial.docxtelegramvip
 
AngularJS for Legacy Apps
AngularJS for Legacy AppsAngularJS for Legacy Apps
AngularJS for Legacy AppsPeter Drinnan
 
Angular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseEPAM Systems
 
Kalp Corporate Angular Js Tutorials
Kalp Corporate Angular Js TutorialsKalp Corporate Angular Js Tutorials
Kalp Corporate Angular Js TutorialsKalp Corporate
 
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical UniversityASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical UniversitySyed Shanu
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS BasicsRavi Mone
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to AngularjsGaurav Agrawal
 
Angular js getting started
Angular js getting startedAngular js getting started
Angular js getting startedHemant Mali
 

Similar to Animation And Testing In AngularJS (20)

One Weekend With AngularJS
One Weekend With AngularJSOne Weekend With AngularJS
One Weekend With AngularJS
 
Angular js
Angular jsAngular js
Angular js
 
Getting Started with AngularJS
Getting Started with AngularJSGetting Started with AngularJS
Getting Started with AngularJS
 
Training On Angular Js
Training On Angular JsTraining On Angular Js
Training On Angular Js
 
GDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and WorkshopGDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and Workshop
 
Formation angular js/Ionic
Formation angular js/IonicFormation angular js/Ionic
Formation angular js/Ionic
 
Angular js interview question answer for fresher
Angular js interview question answer for fresherAngular js interview question answer for fresher
Angular js interview question answer for fresher
 
Angular js
Angular jsAngular js
Angular js
 
AngularJS By Vipin
AngularJS By VipinAngularJS By Vipin
AngularJS By Vipin
 
introduction to Angularjs basics
introduction to Angularjs basicsintroduction to Angularjs basics
introduction to Angularjs basics
 
Angular - Beginner
Angular - BeginnerAngular - Beginner
Angular - Beginner
 
Building a dashboard using AngularJS
Building a dashboard using AngularJSBuilding a dashboard using AngularJS
Building a dashboard using AngularJS
 
angularjs_tutorial.docx
angularjs_tutorial.docxangularjs_tutorial.docx
angularjs_tutorial.docx
 
AngularJS for Legacy Apps
AngularJS for Legacy AppsAngularJS for Legacy Apps
AngularJS for Legacy Apps
 
Angular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete Course
 
Kalp Corporate Angular Js Tutorials
Kalp Corporate Angular Js TutorialsKalp Corporate Angular Js Tutorials
Kalp Corporate Angular Js Tutorials
 
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical UniversityASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
 
Angular js getting started
Angular js getting startedAngular js getting started
Angular js getting started
 

More from Edureka!

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaEdureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaEdureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaEdureka!
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaEdureka!
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaEdureka!
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaEdureka!
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaEdureka!
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaEdureka!
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaEdureka!
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaEdureka!
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | EdurekaEdureka!
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEdureka!
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEdureka!
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaEdureka!
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaEdureka!
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaEdureka!
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaEdureka!
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaEdureka!
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | EdurekaEdureka!
 

More from Edureka! (20)

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | Edureka
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | Edureka
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | Edureka
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | Edureka
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | Edureka
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| Edureka
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | 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 : sales@edureka.co 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