SlideShare a Scribd company logo
1 of 19
SINGLE PAGE APPLICATION 5
ENG. ISMAIL ENJRENY
Filters
• Filters allow you to declare how to transform data for display to the user within
an interpolation in your template.
{{ expression | filtername : parameter1 : ...parametern }}
• You’re not limited to the bundled filters, and it is simple to write your own
{{12.9 | currency}}  $12.90
Filters (cont.)
• Formatting Filters: AngularJS comes with a set of built-in formatting filters which can be used in conjunction with
the interpolation directive, and with ng-bind
• date
• currency
• number
• lowercase
• uppercase
• json
• Array Filters
• limitTo
• filter
• orderBy
Filters - date (cont.)
• Formats date to a string based on the requested format
{{ date_expression | date : format : timezone}}
• Examples:
• <span>{{1288323623006 | date:'medium'}}</span> -> Oct 29, 2010 6:40:23 AM
• <span>{{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}</span>
• 10/29/2010 @ 6:40AM
Filters - currency (cont.)
• Formats a number as a currency (ie $1,234.56). When no currency symbol is
provided, default symbol for current locale is used.
• {{ currency_expression | currency : symbol : fractionsize}}
<pre ng-non-bindable>{{168 | currency : ‘SAR' : 0}}</pre> =
SAR168
Filters - number (cont.)
• Formats a number as text
• {{number_expression | number : fractionsize}}
{{2434.656 | number:2 }} = 2,434.66
Filters - lowercase (cont.)
• Converts string to lowercase.
• {{ lowercase_expression | lowercase}}
{{'HELLO ismaeel' | lowercase}} = hello ismaeel
Filters - uppercase (cont.)
• Converts string to uppercase.
• {{ uppercase_expression | uppercase}}
{{'HELLO ismaeel' | uppercase}} = HELLO ISMAEEL
Filters - json (cont.)
• Allows you to convert a JavaScript object into JSON string.
• {{ json_expression | json : spacing}}
Filters - limitTo (cont.)
• Creates a new array or string containing only a specified number of elements.
The elements are taken from either the beginning or the end of the source
array, string or number, as specified by the value and sign (positive or negative)
of limit. If a number is used as input, it is converted to a string.
• {{ limitto_expression | limitto : limit}}
{{'Hello Angular' | limitTo:5}} = Hello
Filters - orderBy (cont.)
• Orders a specified array by the expression predicate. It is ordered alphabetically
for strings and numerically for numbers.
• {{ array | orderBy : expression : reverse}}
Filters - filter (cont.)
• Selects a subset of items from array and returns it as a new array.
• {{ filter_expression | filter : comparator}}
Filters (cont.)
• $filter('currency')(amount, symbol, fractionsize)
• $filter('date')(date, format, timezone)
• $filter('filter')(array, expression, comparator)
• $filter('json')(object, spacing)
• $filter('limitTo')(input, limit)
• $filter('lowercase')(input)
• $filter('number')(number, fractionsize)
• $filter('orderby')(array, expression, reverse)
• $filter('uppercase')(input)
$http
• The $http service is a core Angular service that facilitates communication with the
remote HTTP servers via the browser's XMLHttpRequest object or via JSONP.
• Methods
• get
• head
• post
• put
• delete
• jsonp
• patch
$http – Caching (cont.)
• To enable caching, set the request configuration cache property to true (to use
default cache) or to a custom cache object (built with $cacheFactory).
• When the cache is enabled, $http stores the response from the server in the
specified cache. The next time the same request is made, the response is served
from the cache without sending a request to the server.
$http – config (cont.)
• method: GET, POST, …
• url: Absolute or relative URL of the resource that is being requested.
• params: Map of strings or objects which will be turned to
?key1=value1&key2=value2 after the url. If the value is not a string, it will be
JSONified.
• data: {string|Object} – Data to be sent as the request message data.
• headers: {Object} – Map of strings or functions which return strings representing
HTTP headers to send to the server. If the return value of a function is null, the
header will not be sent. Functions accept a config object as an argument.
$http – config (cont.)
• xsrfHeaderName: {string} – Name of HTTP header to populate with the XSRF token.
• xsrfCookieName: {string} – Name of cookie containing the XSRF token.
• cache: {boolean|Cache} – If true, a default $http cache will be used to cache the GET
request, otherwise if a cache instance built with $cacheFactory, this cache will be
used for caching.
• timeout: {number} – timeout in milliseconds.
• withCredentials: {boolean} - whether to set the withCredentials flag on the XHR
object.
• responseType: either use emoty string (default value) or use json as value.
$http – config (cont.)
• success(function (data, status, headers, config) {}
• error(function (data, status, headers, config) {}
NEXT?

More Related Content

What's hot

Refinement Types for Haskell
Refinement Types for HaskellRefinement Types for Haskell
Refinement Types for HaskellMartin Ockajak
 
Comparing Haskell & Scala
Comparing Haskell & ScalaComparing Haskell & Scala
Comparing Haskell & ScalaMartin Ockajak
 
Scala for Java Developers
Scala for Java DevelopersScala for Java Developers
Scala for Java DevelopersMartin Ockajak
 
Functions & closures
Functions & closuresFunctions & closures
Functions & closuresKnoldus Inc.
 
Exp 6.1 d-422-1
Exp 6.1  d-422-1Exp 6.1  d-422-1
Exp 6.1 d-422-1Omkar Rane
 
QuickCheck - Software Testing
QuickCheck - Software TestingQuickCheck - Software Testing
QuickCheck - Software TestingJavran
 
Array within a class
Array within a classArray within a class
Array within a classAAKASH KUMAR
 
Legacy lambda code
Legacy lambda codeLegacy lambda code
Legacy lambda codePeter Lawrey
 
array of object pointer in c++
array of object pointer in c++array of object pointer in c++
array of object pointer in c++Arpita Patel
 
Streams and lambdas the good, the bad and the ugly
Streams and lambdas the good, the bad and the uglyStreams and lambdas the good, the bad and the ugly
Streams and lambdas the good, the bad and the uglyPeter Lawrey
 
SQL Subqueries - Oracle SQL Fundamentals
SQL Subqueries - Oracle SQL FundamentalsSQL Subqueries - Oracle SQL Fundamentals
SQL Subqueries - Oracle SQL FundamentalsMuhammadWaheed44
 
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
 JavaScript - Chapter 9 - TypeConversion and Regular Expressions  JavaScript - Chapter 9 - TypeConversion and Regular Expressions
JavaScript - Chapter 9 - TypeConversion and Regular Expressions WebStackAcademy
 

What's hot (20)

Refinement Types for Haskell
Refinement Types for HaskellRefinement Types for Haskell
Refinement Types for Haskell
 
Comparing Haskell & Scala
Comparing Haskell & ScalaComparing Haskell & Scala
Comparing Haskell & Scala
 
Scala for Java Developers
Scala for Java DevelopersScala for Java Developers
Scala for Java Developers
 
Using xml in a data set (ado.net)
Using xml in a data set (ado.net)Using xml in a data set (ado.net)
Using xml in a data set (ado.net)
 
Functions & closures
Functions & closuresFunctions & closures
Functions & closures
 
Templates in c++
Templates in c++Templates in c++
Templates in c++
 
C# 4.0 dynamic
C# 4.0 dynamicC# 4.0 dynamic
C# 4.0 dynamic
 
Exp 6.1 d-422-1
Exp 6.1  d-422-1Exp 6.1  d-422-1
Exp 6.1 d-422-1
 
Head first latex
Head first latexHead first latex
Head first latex
 
QuickCheck - Software Testing
QuickCheck - Software TestingQuickCheck - Software Testing
QuickCheck - Software Testing
 
Algorithm and Programming (Array)
Algorithm and Programming (Array)Algorithm and Programming (Array)
Algorithm and Programming (Array)
 
Linear data structure concepts
Linear data structure conceptsLinear data structure concepts
Linear data structure concepts
 
Array within a class
Array within a classArray within a class
Array within a class
 
AngularJS filters
AngularJS filtersAngularJS filters
AngularJS filters
 
Apache Spark - Aram Mkrtchyan
Apache Spark - Aram MkrtchyanApache Spark - Aram Mkrtchyan
Apache Spark - Aram Mkrtchyan
 
Legacy lambda code
Legacy lambda codeLegacy lambda code
Legacy lambda code
 
array of object pointer in c++
array of object pointer in c++array of object pointer in c++
array of object pointer in c++
 
Streams and lambdas the good, the bad and the ugly
Streams and lambdas the good, the bad and the uglyStreams and lambdas the good, the bad and the ugly
Streams and lambdas the good, the bad and the ugly
 
SQL Subqueries - Oracle SQL Fundamentals
SQL Subqueries - Oracle SQL FundamentalsSQL Subqueries - Oracle SQL Fundamentals
SQL Subqueries - Oracle SQL Fundamentals
 
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
 JavaScript - Chapter 9 - TypeConversion and Regular Expressions  JavaScript - Chapter 9 - TypeConversion and Regular Expressions
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
 

Viewers also liked

Viewers also liked (6)

Single page application 03
Single page application   03Single page application   03
Single page application 03
 
Solr Introduction
Solr IntroductionSolr Introduction
Solr Introduction
 
Redis - Partitioning
Redis - PartitioningRedis - Partitioning
Redis - Partitioning
 
Redis Clients Handling
Redis Clients HandlingRedis Clients Handling
Redis Clients Handling
 
Redis Security
Redis SecurityRedis Security
Redis Security
 
Single page application 04
Single page application   04Single page application   04
Single page application 04
 

Similar to FILTERS AND HTTP REQUESTS IN SPA

json.ppt download for free for college project
json.ppt download for free for college projectjson.ppt download for free for college project
json.ppt download for free for college projectAmitSharma397241
 
Query String Parameters & Methods in NodeJS.pptx
Query String Parameters & Methods in NodeJS.pptxQuery String Parameters & Methods in NodeJS.pptx
Query String Parameters & Methods in NodeJS.pptxHemaSenthil5
 
tutorial 10 Exploring Arrays, Loops, and conditional statements.ppt
tutorial 10 Exploring Arrays, Loops, and conditional statements.ppttutorial 10 Exploring Arrays, Loops, and conditional statements.ppt
tutorial 10 Exploring Arrays, Loops, and conditional statements.pptAbdisamedAdam
 
Web technologies-course 10.pptx
Web technologies-course 10.pptxWeb technologies-course 10.pptx
Web technologies-course 10.pptxStefan Oprea
 
Advance topics of C language
Advance  topics of C languageAdvance  topics of C language
Advance topics of C languageMehwish Mehmood
 
Query String Parameters & Methods in NodeJS.pptx
Query String Parameters & Methods in NodeJS.pptxQuery String Parameters & Methods in NodeJS.pptx
Query String Parameters & Methods in NodeJS.pptxHemaSenthil5
 
Json - ideal for data interchange
Json - ideal for data interchangeJson - ideal for data interchange
Json - ideal for data interchangeChristoph Santschi
 
Data weave (MuleSoft)
Data weave (MuleSoft)Data weave (MuleSoft)
Data weave (MuleSoft)Nandu List5
 
Полнотекстовый поиск в PostgreSQL за миллисекунды (Олег Бартунов, Александр К...
Полнотекстовый поиск в PostgreSQL за миллисекунды (Олег Бартунов, Александр К...Полнотекстовый поиск в PostgreSQL за миллисекунды (Олег Бартунов, Александр К...
Полнотекстовый поиск в PostgreSQL за миллисекунды (Олег Бартунов, Александр К...Ontico
 
Informatica overview
Informatica overviewInformatica overview
Informatica overviewkarthik kumar
 
Informatica overview
Informatica overviewInformatica overview
Informatica overviewkarthik kumar
 
Sql server 2016: System Databases, data types, DML, json, and built-in functions
Sql server 2016: System Databases, data types, DML, json, and built-in functionsSql server 2016: System Databases, data types, DML, json, and built-in functions
Sql server 2016: System Databases, data types, DML, json, and built-in functionsSeyed Ibrahim
 
MongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkMongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkChris Westin
 
Algorithms devised for a google interview
Algorithms devised for a google interviewAlgorithms devised for a google interview
Algorithms devised for a google interviewRussell Childs
 
Exploiting the query structure for efficient join ordering in SPARQL queries
Exploiting the query structure for efficient join ordering in SPARQL queriesExploiting the query structure for efficient join ordering in SPARQL queries
Exploiting the query structure for efficient join ordering in SPARQL queriesLuiz Henrique Zambom Santana
 

Similar to FILTERS AND HTTP REQUESTS IN SPA (20)

json.ppt download for free for college project
json.ppt download for free for college projectjson.ppt download for free for college project
json.ppt download for free for college project
 
Query String Parameters & Methods in NodeJS.pptx
Query String Parameters & Methods in NodeJS.pptxQuery String Parameters & Methods in NodeJS.pptx
Query String Parameters & Methods in NodeJS.pptx
 
Json the-x-in-ajax1588
Json the-x-in-ajax1588Json the-x-in-ajax1588
Json the-x-in-ajax1588
 
tutorial 10 Exploring Arrays, Loops, and conditional statements.ppt
tutorial 10 Exploring Arrays, Loops, and conditional statements.ppttutorial 10 Exploring Arrays, Loops, and conditional statements.ppt
tutorial 10 Exploring Arrays, Loops, and conditional statements.ppt
 
Web technologies-course 10.pptx
Web technologies-course 10.pptxWeb technologies-course 10.pptx
Web technologies-course 10.pptx
 
Advance topics of C language
Advance  topics of C languageAdvance  topics of C language
Advance topics of C language
 
Query String Parameters & Methods in NodeJS.pptx
Query String Parameters & Methods in NodeJS.pptxQuery String Parameters & Methods in NodeJS.pptx
Query String Parameters & Methods in NodeJS.pptx
 
Json - ideal for data interchange
Json - ideal for data interchangeJson - ideal for data interchange
Json - ideal for data interchange
 
Pandas csv
Pandas csvPandas csv
Pandas csv
 
JavaScript.pptx
JavaScript.pptxJavaScript.pptx
JavaScript.pptx
 
Data weave (MuleSoft)
Data weave (MuleSoft)Data weave (MuleSoft)
Data weave (MuleSoft)
 
Полнотекстовый поиск в PostgreSQL за миллисекунды (Олег Бартунов, Александр К...
Полнотекстовый поиск в PostgreSQL за миллисекунды (Олег Бартунов, Александр К...Полнотекстовый поиск в PostgreSQL за миллисекунды (Олег Бартунов, Александр К...
Полнотекстовый поиск в PostgreSQL за миллисекунды (Олег Бартунов, Александр К...
 
Mongo db queries
Mongo db queriesMongo db queries
Mongo db queries
 
Informatica overview
Informatica overviewInformatica overview
Informatica overview
 
Informatica overview
Informatica overviewInformatica overview
Informatica overview
 
Sql server 2016: System Databases, data types, DML, json, and built-in functions
Sql server 2016: System Databases, data types, DML, json, and built-in functionsSql server 2016: System Databases, data types, DML, json, and built-in functions
Sql server 2016: System Databases, data types, DML, json, and built-in functions
 
MongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkMongoDB's New Aggregation framework
MongoDB's New Aggregation framework
 
Deep Dive: Amazon DynamoDB
Deep Dive: Amazon DynamoDBDeep Dive: Amazon DynamoDB
Deep Dive: Amazon DynamoDB
 
Algorithms devised for a google interview
Algorithms devised for a google interviewAlgorithms devised for a google interview
Algorithms devised for a google interview
 
Exploiting the query structure for efficient join ordering in SPARQL queries
Exploiting the query structure for efficient join ordering in SPARQL queriesExploiting the query structure for efficient join ordering in SPARQL queries
Exploiting the query structure for efficient join ordering in SPARQL queries
 

More from Ismaeel Enjreny

Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to ElasticsearchIsmaeel Enjreny
 
Elastic 101 ingest manager
Elastic 101   ingest managerElastic 101   ingest manager
Elastic 101 ingest managerIsmaeel Enjreny
 
WSO2 Identity Server - Getting Started
WSO2 Identity Server - Getting StartedWSO2 Identity Server - Getting Started
WSO2 Identity Server - Getting StartedIsmaeel Enjreny
 
Wso2 is integration with .net core
Wso2 is   integration with .net coreWso2 is   integration with .net core
Wso2 is integration with .net coreIsmaeel Enjreny
 
Deploy Elasticsearch Cluster on Kubernetes
Deploy Elasticsearch Cluster on KubernetesDeploy Elasticsearch Cluster on Kubernetes
Deploy Elasticsearch Cluster on KubernetesIsmaeel Enjreny
 
Redis 101 Data Structure
Redis 101 Data StructureRedis 101 Data Structure
Redis 101 Data StructureIsmaeel Enjreny
 
Elastic 101 ingest manager
Elastic 101   ingest managerElastic 101   ingest manager
Elastic 101 ingest managerIsmaeel Enjreny
 
Getting started with Elasticsearch in .net
Getting started with Elasticsearch in .netGetting started with Elasticsearch in .net
Getting started with Elasticsearch in .netIsmaeel Enjreny
 
Elastic 101 log enrichment
Elastic 101   log enrichmentElastic 101   log enrichment
Elastic 101 log enrichmentIsmaeel Enjreny
 
Elastic 101 index operations
Elastic 101   index operationsElastic 101   index operations
Elastic 101 index operationsIsmaeel Enjreny
 
Elastic 101 - Get started
Elastic 101 - Get startedElastic 101 - Get started
Elastic 101 - Get startedIsmaeel Enjreny
 
دليل البرمجة باستخدام Dynamo DB للمبتدئين
دليل البرمجة باستخدام Dynamo DB للمبتدئيندليل البرمجة باستخدام Dynamo DB للمبتدئين
دليل البرمجة باستخدام Dynamo DB للمبتدئينIsmaeel Enjreny
 

More from Ismaeel Enjreny (20)

Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to Elasticsearch
 
Fleet and elastic agent
Fleet and elastic agentFleet and elastic agent
Fleet and elastic agent
 
Elastic 101 ingest manager
Elastic 101   ingest managerElastic 101   ingest manager
Elastic 101 ingest manager
 
Elastic 101 - API Logs
Elastic 101 - API Logs Elastic 101 - API Logs
Elastic 101 - API Logs
 
WSO2 Identity Server - Getting Started
WSO2 Identity Server - Getting StartedWSO2 Identity Server - Getting Started
WSO2 Identity Server - Getting Started
 
Elasticsearch k8s
Elasticsearch k8sElasticsearch k8s
Elasticsearch k8s
 
ELK Observability 1
ELK Observability 1ELK Observability 1
ELK Observability 1
 
ELK observability 2
ELK observability 2ELK observability 2
ELK observability 2
 
Wso2 is integration with .net core
Wso2 is   integration with .net coreWso2 is   integration with .net core
Wso2 is integration with .net core
 
Deploy Elasticsearch Cluster on Kubernetes
Deploy Elasticsearch Cluster on KubernetesDeploy Elasticsearch Cluster on Kubernetes
Deploy Elasticsearch Cluster on Kubernetes
 
Redis 101 Data Structure
Redis 101 Data StructureRedis 101 Data Structure
Redis 101 Data Structure
 
Redis 101 - INTRO
Redis 101 - INTRORedis 101 - INTRO
Redis 101 - INTRO
 
Elastic 101 ingest manager
Elastic 101   ingest managerElastic 101   ingest manager
Elastic 101 ingest manager
 
Getting started with Elasticsearch in .net
Getting started with Elasticsearch in .netGetting started with Elasticsearch in .net
Getting started with Elasticsearch in .net
 
Elastic 101 log enrichment
Elastic 101   log enrichmentElastic 101   log enrichment
Elastic 101 log enrichment
 
Elastic 101 index operations
Elastic 101   index operationsElastic 101   index operations
Elastic 101 index operations
 
Elastic 101 - Get started
Elastic 101 - Get startedElastic 101 - Get started
Elastic 101 - Get started
 
دليل البرمجة باستخدام Dynamo DB للمبتدئين
دليل البرمجة باستخدام Dynamo DB للمبتدئيندليل البرمجة باستخدام Dynamo DB للمبتدئين
دليل البرمجة باستخدام Dynamo DB للمبتدئين
 
Amazon services iam
Amazon services   iamAmazon services   iam
Amazon services iam
 
Amazon services ec2
Amazon services ec2Amazon services ec2
Amazon services ec2
 

Recently uploaded

Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 

Recently uploaded (20)

Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 

FILTERS AND HTTP REQUESTS IN SPA

  • 1. SINGLE PAGE APPLICATION 5 ENG. ISMAIL ENJRENY
  • 2. Filters • Filters allow you to declare how to transform data for display to the user within an interpolation in your template. {{ expression | filtername : parameter1 : ...parametern }} • You’re not limited to the bundled filters, and it is simple to write your own {{12.9 | currency}}  $12.90
  • 3. Filters (cont.) • Formatting Filters: AngularJS comes with a set of built-in formatting filters which can be used in conjunction with the interpolation directive, and with ng-bind • date • currency • number • lowercase • uppercase • json • Array Filters • limitTo • filter • orderBy
  • 4. Filters - date (cont.) • Formats date to a string based on the requested format {{ date_expression | date : format : timezone}} • Examples: • <span>{{1288323623006 | date:'medium'}}</span> -> Oct 29, 2010 6:40:23 AM • <span>{{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}</span> • 10/29/2010 @ 6:40AM
  • 5. Filters - currency (cont.) • Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default symbol for current locale is used. • {{ currency_expression | currency : symbol : fractionsize}} <pre ng-non-bindable>{{168 | currency : ‘SAR' : 0}}</pre> = SAR168
  • 6. Filters - number (cont.) • Formats a number as text • {{number_expression | number : fractionsize}} {{2434.656 | number:2 }} = 2,434.66
  • 7. Filters - lowercase (cont.) • Converts string to lowercase. • {{ lowercase_expression | lowercase}} {{'HELLO ismaeel' | lowercase}} = hello ismaeel
  • 8. Filters - uppercase (cont.) • Converts string to uppercase. • {{ uppercase_expression | uppercase}} {{'HELLO ismaeel' | uppercase}} = HELLO ISMAEEL
  • 9. Filters - json (cont.) • Allows you to convert a JavaScript object into JSON string. • {{ json_expression | json : spacing}}
  • 10. Filters - limitTo (cont.) • Creates a new array or string containing only a specified number of elements. The elements are taken from either the beginning or the end of the source array, string or number, as specified by the value and sign (positive or negative) of limit. If a number is used as input, it is converted to a string. • {{ limitto_expression | limitto : limit}} {{'Hello Angular' | limitTo:5}} = Hello
  • 11. Filters - orderBy (cont.) • Orders a specified array by the expression predicate. It is ordered alphabetically for strings and numerically for numbers. • {{ array | orderBy : expression : reverse}}
  • 12. Filters - filter (cont.) • Selects a subset of items from array and returns it as a new array. • {{ filter_expression | filter : comparator}}
  • 13. Filters (cont.) • $filter('currency')(amount, symbol, fractionsize) • $filter('date')(date, format, timezone) • $filter('filter')(array, expression, comparator) • $filter('json')(object, spacing) • $filter('limitTo')(input, limit) • $filter('lowercase')(input) • $filter('number')(number, fractionsize) • $filter('orderby')(array, expression, reverse) • $filter('uppercase')(input)
  • 14. $http • The $http service is a core Angular service that facilitates communication with the remote HTTP servers via the browser's XMLHttpRequest object or via JSONP. • Methods • get • head • post • put • delete • jsonp • patch
  • 15. $http – Caching (cont.) • To enable caching, set the request configuration cache property to true (to use default cache) or to a custom cache object (built with $cacheFactory). • When the cache is enabled, $http stores the response from the server in the specified cache. The next time the same request is made, the response is served from the cache without sending a request to the server.
  • 16. $http – config (cont.) • method: GET, POST, … • url: Absolute or relative URL of the resource that is being requested. • params: Map of strings or objects which will be turned to ?key1=value1&key2=value2 after the url. If the value is not a string, it will be JSONified. • data: {string|Object} – Data to be sent as the request message data. • headers: {Object} – Map of strings or functions which return strings representing HTTP headers to send to the server. If the return value of a function is null, the header will not be sent. Functions accept a config object as an argument.
  • 17. $http – config (cont.) • xsrfHeaderName: {string} – Name of HTTP header to populate with the XSRF token. • xsrfCookieName: {string} – Name of cookie containing the XSRF token. • cache: {boolean|Cache} – If true, a default $http cache will be used to cache the GET request, otherwise if a cache instance built with $cacheFactory, this cache will be used for caching. • timeout: {number} – timeout in milliseconds. • withCredentials: {boolean} - whether to set the withCredentials flag on the XHR object. • responseType: either use emoty string (default value) or use json as value.
  • 18. $http – config (cont.) • success(function (data, status, headers, config) {} • error(function (data, status, headers, config) {}
  • 19. NEXT?