KEMBAR78
Live Demo : Trending Angular JS Featues | PPTX
www.edureka.co/angular-js
View AngularJS course details at www.edureka.co/angular-js
For Queries during the session and class recording:
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
Live Demo : AngularJS Trending Features
Slide 2 www.edureka.co/angular-jsSlide 2
Objectives
At the end of this module, you will be able to understand:
Controllers
Two Way Data Binding
Custom Directives and Filters
Unit Testing in AngularJS
AngularJS with Node.js
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
DEMO
Controllers
Slide 10 www.edureka.co/angular-js
DEMO
Two Way Data Binding
Slide 11 www.edureka.co/angular-jsSlide 11Slide 11Slide 11
Why Custom Directives?
If AngularJS comes up with wide rich
variety of directives, why it is
required to create custom directive?
Slide 12 www.edureka.co/angular-jsSlide 12
Need of Custom Directives
AngularJS comes with a lot of built-in directives which can successfully manipulate the DOM elements and
perform data binding much more...
But at certain times like converting collection into grid and display in view breaks separation of concerns, so it
is necessary to create directives as an element or attribute etc. This module will focus on the guidelines of
creating the custom directives
Slide 13 www.edureka.co/angular-jsSlide 13
Custom Directive Usage
For a module “MyAppModule” a directive with restrict option will be done in the following way
angular.module(MyModule', [])
.directive(‘myDirective', function () {
return {
restrict: 'A',
link: function (scope, elem, attrs) {
}
}
Module Definition
Directive
Definition
Restrict
Option
Slide 14 www.edureka.co/angular-js
DEMO
Creating Custom Directive
Slide 15 www.edureka.co/angular-jsSlide 15Slide 15Slide 15
Why Custom Filters
If AngularJS comes up with wide rich
variety of filters, why it is required to
create custom filters?
Slide 16 www.edureka.co/angular-jsSlide 16
Need of Custom Filters
AngularJS comes with a lot of in-built filters which helps to build applications faster and easier. But there are
some scenarios like in case of Angular currency filter, we need the denominations to be displayed differently
than the built-in functionality. In scenarios like these we need to develop custom filters
Slide 17 www.edureka.co/angular-jsSlide 17
Custom Filter Structure
 AngularJS comes with elegant way of creating Filters
 Integrating filters to the current application is lot easier by using the below syntax
app.filter(‘filterName', function() {
return function(input, option1, option2) {
var out;
//function code
return out;
});
Slide 18 www.edureka.co/angular-js
DEMO
CUSTOM FILTERS
Slide 19 www.edureka.co/angular-jsSlide 19
Unit Testing
Slide 20 www.edureka.co/angular-jsSlide 20
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 21 www.edureka.co/angular-jsSlide 21
Unit Testing With Angular.js
Add Test
Watch
Test Fail
Watch
Code
Run Test
Refactor
Slide 22 www.edureka.co/angular-js
DEMO
Unit Test
Slide 23 www.edureka.co/angular-jsSlide 23
Node.js
Node.js is an open source JavaScript runtime environment to develop server side applications
Node.js runs on V8 JavaScript Engine, V8 is written in C++
Slide 24 www.edureka.co/angular-jsSlide 24
Why Node.js ?
Why it is required to run an
application in JavaScript server
environment like Node.js ?
Slide 25 www.edureka.co/angular-jsSlide 25
Node.js Architecture
Slide 26 www.edureka.co/angular-jsSlide 26
Who uses Node.js?
Slide 27 www.edureka.co/angular-js
DEMO
Node.js with Angular
Slide 28 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 29 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 30 www.edureka.co/angular-jsSlide 30Slide 30Slide 30
Limited Period Offer
On AngularJS Course
To avail this offer please contact us:
US : 1800 275 9730 (toll free)
INDIA : +91 88808 62004
Email Us : sales@edureka.co
25% Off
Slide 31 www.edureka.co/angular-js
Questions
Slide 32 www.edureka.co/angular-js

Live Demo : Trending Angular JS Featues

  • 1.
    www.edureka.co/angular-js View AngularJS coursedetails at www.edureka.co/angular-js For Queries during the session and class recording: 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 Live Demo : AngularJS Trending Features
  • 2.
    Slide 2 www.edureka.co/angular-jsSlide2 Objectives At the end of this module, you will be able to understand: Controllers Two Way Data Binding Custom Directives and Filters Unit Testing in AngularJS AngularJS with Node.js
  • 3.
    Slide 3 www.edureka.co/angular-jsSlide3 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-jsSlide4 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-jsSlide5 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-jsSlide6Slide 6Slide 6 Putting Everything Together How to bring relation between Model, Controller and Templates in the application?
  • 7.
    Slide 7 www.edureka.co/angular-jsSlide7Slide 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-jsSlide8Slide 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.
  • 10.
  • 11.
    Slide 11 www.edureka.co/angular-jsSlide11Slide 11Slide 11 Why Custom Directives? If AngularJS comes up with wide rich variety of directives, why it is required to create custom directive?
  • 12.
    Slide 12 www.edureka.co/angular-jsSlide12 Need of Custom Directives AngularJS comes with a lot of built-in directives which can successfully manipulate the DOM elements and perform data binding much more... But at certain times like converting collection into grid and display in view breaks separation of concerns, so it is necessary to create directives as an element or attribute etc. This module will focus on the guidelines of creating the custom directives
  • 13.
    Slide 13 www.edureka.co/angular-jsSlide13 Custom Directive Usage For a module “MyAppModule” a directive with restrict option will be done in the following way angular.module(MyModule', []) .directive(‘myDirective', function () { return { restrict: 'A', link: function (scope, elem, attrs) { } } Module Definition Directive Definition Restrict Option
  • 14.
  • 15.
    Slide 15 www.edureka.co/angular-jsSlide15Slide 15Slide 15 Why Custom Filters If AngularJS comes up with wide rich variety of filters, why it is required to create custom filters?
  • 16.
    Slide 16 www.edureka.co/angular-jsSlide16 Need of Custom Filters AngularJS comes with a lot of in-built filters which helps to build applications faster and easier. But there are some scenarios like in case of Angular currency filter, we need the denominations to be displayed differently than the built-in functionality. In scenarios like these we need to develop custom filters
  • 17.
    Slide 17 www.edureka.co/angular-jsSlide17 Custom Filter Structure  AngularJS comes with elegant way of creating Filters  Integrating filters to the current application is lot easier by using the below syntax app.filter(‘filterName', function() { return function(input, option1, option2) { var out; //function code return out; });
  • 18.
  • 19.
  • 20.
    Slide 20 www.edureka.co/angular-jsSlide20 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
  • 21.
    Slide 21 www.edureka.co/angular-jsSlide21 Unit Testing With Angular.js Add Test Watch Test Fail Watch Code Run Test Refactor
  • 22.
  • 23.
    Slide 23 www.edureka.co/angular-jsSlide23 Node.js Node.js is an open source JavaScript runtime environment to develop server side applications Node.js runs on V8 JavaScript Engine, V8 is written in C++
  • 24.
    Slide 24 www.edureka.co/angular-jsSlide24 Why Node.js ? Why it is required to run an application in JavaScript server environment like Node.js ?
  • 25.
  • 26.
  • 27.
  • 28.
    Slide 28 www.edureka.co/angular-js LIVEOnline Class Class Recording in LMS 24/7 Post Class Support Module Wise Quiz Project Work Verifiable Certificate Course Features
  • 29.
    Slide 29 www.edureka.co/angular-js CourseTopics  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
  • 30.
    Slide 30 www.edureka.co/angular-jsSlide30Slide 30Slide 30 Limited Period Offer On AngularJS Course To avail this offer please contact us: US : 1800 275 9730 (toll free) INDIA : +91 88808 62004 Email Us : sales@edureka.co 25% Off
  • 31.
  • 32.

Editor's Notes

  • #3 PRD layout, Understanding it's basic features, designing basic report containing graphical chart, Conditional Formatting, studying the PRPT file format, building a basic report in PDF report