MY REFERENCES
Angularjs Benefits Over Javascript
Angular js benefits over
javascript...........
1. Magical Two-Way data binding.
2. Routing Support.
3.Structure front end code.
4.Templating with HTML.
5. Teach HTML new syntax with directives.
6.Embeddable, testable, and injectable.
7. Powered by Google and an active community.
The angular team built a plugin for the
Google chrome browser called Batarang that
Advantages of AngularJS
• AngularJS provides capability to create Single
Page Application in a very clean and
maintainable way.
• AngularJS provides data binding capability to
HTML thus giving user a rich and responsive
experience
• AngularJS code is unit testable.
• AngularJS uses dependency injection and
make use of separation of concerns.
AngularJS provides reusable components.
With AngularJS, developer write less code
and get more functionality.
In AngularJS, views are pure html pages, and
controllers written in javascript do the
business processing.
On top of everything, AngularJS applications
can run on all major browsers and smart
phones including Android and iOS based
phones/tablets.
Disadvantages of AngulaJS
• Not Secure : Being JavaScript only
framework, application written in
AngularJS are not safe. Server side
authentication and authorization is must
to keep an application secure.
• Not degradable: If your application user
disables Javascript then user will just see
the basic page and nothing more.
Angular JS Factory, Service and Provider
• Factory
• A factory is a simple function which allows you
to add some logic before creating the object.
It returns the created object.
• Syntax
app.factory('serviceName',function(){
return serviceObj;
})
Creating service using factory method
<script>
//creating module
var app = angular.module('app', []);
//define a factory using factory() function
app.factory('MyFactory', function () {
var serviceObj = {};
serviceObj.function1 = function () {
//TO DO:
};
serviceObj.function2 = function () {
//TO DO:
};
return serviceObj;
});
</script>
When to use
It is just a collection of functions like a class. Hence, it
can be instantiated in different controllers when you are
using it with constructor function.
Service
A service is a constructor function which creates the
object using new keyword. You can add properties and
functions to a service object by using this keyword.
Unlike factory, it doesn’t return anything.
Syntax
app.service('serviceName',function(){
})
Creating service using service method
1.<script>
2.//creating module
3.var app = angular.module('app', []);
4.
5.//define a service using service() function
6.app.service('MyService', function () {
7.this.function1 = function () {
8.//TO DO:
9.};
10.
11.this.function2 = function () {
12.//TO DO:
13.};
14.});
15.</script>
When to use
It is a singleton object. Use it when you need to share a single object
across the application. For example, authenticated user details.
Provider
A provider is used to create a configurable service object.
It returns value by using $get() function.
Syntax
//creating a service
app.provider('serviceName',function(){
});
//configuring the service
app.config(function(serviceNameProvider){
});
Creating service using provider method
<script>
//define a provider using provider() function
app.provider('configurableService', function () {
var name = '';
this.setName = function (newName) {
name = newName;
};
this.$get = function () {
return name;
};
});
//configuring provider using config() function
app.config(function (configurableService) {
configurableService.setName('www.dotnet-tricks.com');
});
</script>
When to use
When you need to provide module-wise configuration for your service
object before making it available.
AngularJS : Factory, Service and Provider with
example
<html>
<head>
<title>AngularJS Service Factory and Providers</title>
<script src="lib/angular.js"></script>
</head>
<body>
<div class="container" style="padding-top:20px;">
<div ng-app="myApp" ng-controller="myController">
<p>From Service: </p>
<p>From Factory: </p>
<p>From Provider: </p>
</div>
</div>
<script>
//defining module
var app = angular.module('myApp', []);
//defining service
app.service('myService', function () {
this.name = '';
this.setName = function (newName) {
this.name = newName;
return this.name;
};
});
//defining factory
app.factory('myFactory', function () {
var serviceObj = {};
serviceObj.name = '';
serviceObj.setName = function (newName) {
serviceObj.name = newName;
};
return serviceObj;
});
//defining provider
app.provider('configurable', function () {
var privateName = '';
this.setName = function (newName) {
privateName = newName;
};
this.$get = function () {
return {
name: privateName
};
};
});
//configuring provider
app.config(function (configurableProvider) {
configurableProvider.setName("Saksham Chauhan");
});
//defining controller
app.controller('myController', function ($scope,
myService, myFactory, configurable) {
$scope.serviceName =
myService.setName("Saksham Chauhan");
myFactory.setName("Saksham Chauhan");
$scope.factoryName = myFactory.name;
$scope.providerName = configurable.name;
});
</script>
</body>
</html>
How it works...
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
Mean stack Magics
SaaS
Software as a service (or SaaS) is a way of delivering
applications over the Internet—as a service. Instead of
installing and maintaining software, you simply access it via
the Internet, freeing yourself from complex software and
hardware management.
SaaS applications are sometimes called Web-based
software, on-demand software, or hosted software.
Whatever the name, SaaS applications run on a SaaS
provider’s servers. The provider manages access to the
application, including security, availability, and
performance.
SAAS: THE PAYOFF
SaaS customers have no hardware or software to buy,
install, maintain, or update. Access to applications is easy:
You just need an Internet connection.
SaaS Characteristics
A good way to understand the SaaS model is by thinking of
a bank, which protects the privacy of each customer while
providing service that is reliable and secure—on a massive
scale. A bank’s customers all use the same financial systems
and technology without worrying about anyone accessing
their personal information without authorization.
A “bank” meets the key characteristics of the SaaS model:
MULTITENANT ARCHITECTURE
A multitenant architecture, in which all users and applications
share a single, common infrastructure and code base that is
centrally maintained. Because SaaS vendor clients are all on the
same infrastructure and code base, vendors can innovate more
quickly and save the valuable development time previously spent
on maintaining numerous versions of outdated code.
EASY CUSTOMIZATION
The ability for each user to easily customize applications to fit
their business processes without affecting the common
infrastructure. Because of the way SaaS is architected, these
customizations are unique to each company or user and are
always preserved through upgrades. That means SaaS providers
can make upgrades more often, with less customer risk and much
lower adoption cost.
BETTER ACCESS
Improved access to data from any networked device while making
it easier to manage privileges, monitor data use, and ensure
everyone sees the same information at the same time.
SAAS HARNESSES THE CONSUMER WEB
Anyone familiar with Amazon.com or My Yahoo! will be familiar
with the Web interface of typical SaaS applications. With the SaaS
model, you can customize with point-and-click ease, making the
weeks or months it takes to update traditional business software
seem hopelessly old fashioned.
SAAS TRENDS
Organizations are now developing SaaS integration platforms (or
SIPs) for building additional SaaS applications. The consulting firm
Saugatuck Technology calls this the “third wave” in software
adoption: when SaaS moves beyond standalone software
functionality to become a platform for mission-critical
applications.
Node.js
What is Nodejs?
• Node.js is a server side scripting platform
just like php, python or ruby.
• Php depends on Apache or nginx web
servers for handling http request and
response, on the other hand Node.js has
its own http server library allowing us to
have more control on the web server.
Definition of Node
• Node.js is built on Chrome’s JavaScript
runtime V8 for developing fast, scalable
network applications. Node.js uses an
event-driven, non-blocking I/O model
that makes it lightweight and efficient,
perfect for data-intensive real-time
applications that run across distributed
devices.
Advantages of node.js
• Node.js uses java script and it is easy to learn.
• Node.js runs on v8 Engine (a javascript
interpreter: chrome uses it) which is very fast.
• We can build highly scalable web applications
using node.js
• We can develop chat based applications, online
games, API’s and many more.
• Supports interaction with all major databases.
• Node.js has 1000’s of third-party free modules.
Companies depending on node.js
• ebay, Microsoft, Yahoo!,
StrongLoop, OmniTI, Storify, local
response, nodejitsu, Linkedin, Iris
Couch, backbeam, recruitics,
Transloadit, Uber, Voxer,when-to-
manage, Jaleoo, Cloud9 IDE,
NODE the FIRM etc..
Basic terminology
• Asynchronous– Asynchronous means an event
which is happening independently of other
events. The main advantage of the asynchronous
approach is scalability.
•
Npm – Stands for node package manager. This
will help us install the latest modules directly
from the servers instead of checking for the latest
version, downloading and copying to the
appropriate directory. It also has other uses.
Express– Express is a highly recommended web application
framework for node.js. It takes care of the low level services for
us.
Module– A module is a independent, reusable piece of code. you
can download them and use them directly in your project. ex:
express, http, https etc are some of the modules for node.js.
REPL-Read-Eval-Print-Loop provides a way to interact with
javascript it can be used for debugging, testing. To try repl go to
terminal(cmd prompt) and type node and try ex:
console.log(“learn nodejs”);
Mongoose– Mongoose is a MongoDB object modeling tool for
node.js. It becomes easy to interact with mongodb database
server using Mongoose module.
Db-mysql– It is a node.js module to interact with mysql database.
Advantages of Node.js
• Open Source
• Node.js is open source, so it’s free to use and
no need to pay for license. There are also
many open source modules supported by
Node.js.
• JavaScript as Programming Language
• It uses JavaScript as a programming language
for both front-end and back-end which
increase programmer productivity and code
reusability.
• Scalable
• You can scale your Node.js application by using
two ways – Horizontal Scaling and Vertical
Scaling, which helps you to improve your
application performance.
– In Horizontal scaling you can add more nodes to your
existing system.
– In Vertical scaling you can add more resources to a
single node.
• Better Performance
• It provides better performance, since Node.js I/O
operations are non-blocking. Also, it uses V8
JavaScript engine to execute JavaScript code. V8
engine compiles the JS code directly into machine
code which make it fast.
• Caching Support
• Node.js supports caching of modules. Hence, when a
Node.js modules is requested first time, it is cached
into the application memory. So next calls for loading
the same module may not cause the module code to
be executed again.
• Lightweight and Extensible
• Node.js is based on JavaScript which can be executed
on client side as well as server side. Also, it supports
exchange of data using JSON which is easily
consumed by JavaScript. This makes it light weight as
compared to other frameworks.
• Node.js is open source. Hence you can extend it as
per your need.
• REST API Support
• Using Node.js you can also develop RESTful services API easily.
• Unit Testing
• It supports unit testing out of box. You can use any JS unit
testing frameworks like Jasmin to test your Node.js code.
• Server Development
• Node.js has some built-in API which help you to create
different types of Server like HTTP Server, DNS Server, TCP
Server etc.
• Community Support
• Node.js has a wide community of developers around the
world. They are active in development of new modules or
packages to support different types of applications
development.
Limitations of Node.js
• It doesn’t support multi-threaded
programming.
• It doesn’t support very high computational
intensive tasks. When it executes long running
task, it will queue all the incoming requests to
wait for execution, since it follows JavaScript
event loop which is single threaded.
• Node good for executing synchronous and
CPU intensive tasks.
MongoDB
• MongoDB is a cross-platform,
document oriented database that
provides, high performance, high
availability, and easy scalability.
MongoDB works on concept of
collection and document.
Advantages of MongoDB over RDBMS
• Schema less : MongoDB is document
database in which one collection holds
different different documents. Number
of fields, content and size of the
document can be differ from one
document to another.
• Structure of a single object is clear
• No complex joins
• Deep query-ability. MongoDB supports dynamic
queries on documents using a document-based
query language that's nearly as powerful as SQL
• Tuning
• Ease of scale-out: MongoDB is easy to scale
• Conversion / mapping of application objects to
database objects not needed
• Uses internal memory for storing the (windowed)
working set, enabling faster access of data
Why should use MongoDB?
• Document Oriented Storage : Data is stored in
the form of JSON style documents
• Index on any attribute
• Replication & High Availability
• Auto-Sharding
• Rich Queries
• Fast In-Place Updates
• Professional Support By MongoDB
Disadvantages of MDB
• Data size in MongoDB is typically higher due to e.g.
each document has field names stored it
• less flexibity with querying (e.g. no JOINs)
• no support for transactions - certain atomic
operations are supported, at a single document level
• at the moment Map/Reduce (e.g. to do
aggregations/data analysis) is OK, but not blisteringly
fast. So if that's required, something like Hadoop may
need to be added into the mix
• less up to date information available/fast evolving
product
Mean stack Magics
Mean stack Magics
• MEAN stack stands for
• MongoDB as a Database
• Express as the Web Framework
• AngularJS as a frontend framework and
• js as the server platform.
• There are various Advantages of using Mean
Stack:
• You are free to use Mongo DB
• Its cost effective
• You will get benefited by using MongoDB
• MEAN stack uses JSON
• Node.js simplifies the server layer and is super-
fast
JAVASCRIPT Advantages
• Javascript is executed on the client side
This means that the code is executed on the user's processor
instead of the web server thus saving bandwidth and strain on
the web server.
• Javascript is a relatively easy language
The Javascript language is relatively easy to learn and
comprises of syntax that is close to English. It uses the DOM
model that provides plenty of prewritten functionality to the
various objects on pages making it a breeze to develop a
script to solve a custom purpose.
• Javascript is relatively fast to the end user
As the code is executed on the user's computer, results and
processing is completed almost instantly depending on the
task (tasks in javascript on web pages are usually simple so as
to prevent being a memory hog) as it does not need to be
processed in the site's web server and sent back to the user
consuming local as well as server bandwidth.
• Extended functionality to web pages
Third party add-ons like Greasemonkey enable Javascript
developers to write snippets of Javascript which can execute
on desired web pages to extend its functionality. If you use a
website and require a certain feature to be included, you can
write it yourself and use an add-on like Greasemonkey to
implement it on the web page.
Disadvantages
• Security Issues
Javascript snippets, once appended onto web pages execute
on client servers immediately and therefore can also be used
to exploit the user's system. While a certain restriction is set
by modern web standards on browsers, malicious code can
still be executed complying with the restrictions set.
• Javascript rendering varies
Different layout engines may render Javascript differently
resulting in inconsistency in terms of functionality and
interface. While the latest versions of javascript and rendering
have been geared towards a universal standard, certain
variations still exist. Website Usability Consultants all over
the world make a living on these differences, but it enrages
thousands of developers on a daily basis.
Express.js
• Express is a fast, unopinionated
minimalist web framework for Node.js" -
official web site: Expressjs.com
• Express.js is a web application framework
for Node.js. It provides various features
that make web application development
fast and easy which otherwise takes
more time using only Node.js.
• Express.js is based on the Node.js middleware
module called connect which in turn uses http
module. So, any middleware which is based
on connect will also work with Express.js.
Advantages of Express
• Makes Node.js web application development fast and easy.
• Easy to configure and customize.
• Allows you to define routes of your application based on HTTP
methods and URLs.
• Includes various middleware modules which you can use to
perform additional tasks on request and response.
• Easy to integrate with different template engines like Jade,
Vash, EJS etc.
• Allows you to define an error handling middleware.
• Easy to serve static files and resources of your application.
• Allows you to create REST API server.
• Easy to connect with databases such as MongoDB, Redis,
MySQL
Express.js Web Application:
• Express.js provides an easy way to create web
server and render HTML pages for different
HTTP requests by configuring routes for your
application.
• Configure Routes:
Use app object to define different routes of
your application. The app object includes
get(), post(), put() and delete() methods to
define routes for HTTP GET, POST, PUT and
DELETE requests respectively.
Body Parser:
• To handle HTTP POST request in
Express.js version 4 and above, you need
to install middleware module
called body-parser. The middleware was
a part of Express.js earlier but now you
have to install it separately.
• This body-parser module parses the
JSON, buffer, string and url encoded data
submitted using HTTP POST request.
Gulp Vs Grunt
• The biggest advantage of using gulp is that it focuses
on code whereas grunt relies on configuration.
Personally, I have always been a fan of code over
configuration.
• Gulp is a streaming build system. It utilises Node.js
streams and usually executes faster than grunt.
• In reality, gulp plugins are just Node.js streaming
modules that have nothing to do with gulp (except
the name, of course).
• Gulp plugins follow the unix principle : Try to do one
thing well.
• If you are a beginner, you will probably pick up gulp
faster than grunt because of code over configuration.
•Grunt focuses on configuration, while Gulp focuses on
code
•Grunt was built around a set of built-in, and commonly
used tasks, while Gulp came around with the idea of
enforcing nothing, but how community-developed micro-
tasks should connect to each other.
Similarities between Grunt and Gulp
Grunt and Gulp can automate tedious,
human-error-prone build processes
such as:
•code minification.
•code-quality analysis
•image optimization
•vendor-prefixing
•unit-testing
Differences between Grunt and Gulp
• The way you configure your tasks. Grunt
is configuration-based. Gulp is stream-based.
• The way they run your tasks. Grunt runs the
processes you want to execute in a sequential
manner. Gulp tries to run them
with maximum concurrency, meaning it will
try to execute processes in parallel if possible.

More Related Content

PPTX
The Basics Angular JS
PPTX
Intoduction to Angularjs
DOCX
Different way to share data between controllers in angular js
PPTX
Introduction to AngularJS Framework
PDF
One Weekend With AngularJS
PPTX
Training On Angular Js
PDF
Angular js
PDF
AngularJS Best Practices
The Basics Angular JS
Intoduction to Angularjs
Different way to share data between controllers in angular js
Introduction to AngularJS Framework
One Weekend With AngularJS
Training On Angular Js
Angular js
AngularJS Best Practices

What's hot (20)

PDF
PPTX
Kalp Corporate Angular Js Tutorials
PDF
A gently introduction to AngularJS
PPTX
What's new in Angular 2?
PDF
Adding User Management to Node.js
PPSX
PPT
Angular Seminar-js
PDF
Angular from Scratch
PDF
AngularJS Project Setup step-by- step guide - RapidValue Solutions
PDF
AngularJS for Beginners
PDF
Full Angular 7 Firebase Authentication System
PPSX
Building fast and performant apps
PDF
Introduction to React for Frontend Developers
PPT
Introduction to Vaadin
PDF
Introduction to Vaadin
PPTX
Introduction to Angular JS
DOCX
Angular.js interview questions
PDF
RESTful services and OAUTH protocol in IoT
PPTX
Introduction to single page application with angular js
PDF
125 고성능 web view-deview 2013 발표 자료_공유용
Kalp Corporate Angular Js Tutorials
A gently introduction to AngularJS
What's new in Angular 2?
Adding User Management to Node.js
Angular Seminar-js
Angular from Scratch
AngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS for Beginners
Full Angular 7 Firebase Authentication System
Building fast and performant apps
Introduction to React for Frontend Developers
Introduction to Vaadin
Introduction to Vaadin
Introduction to Angular JS
Angular.js interview questions
RESTful services and OAUTH protocol in IoT
Introduction to single page application with angular js
125 고성능 web view-deview 2013 발표 자료_공유용
Ad

Similar to Mean stack Magics (20)

PDF
What is mean stack?
PPT
Top java script frameworks ppt
PDF
Why AngularJS is the Top Choice for Your Next Project
PPTX
Node js installation steps.pptx slide share ppts
PPTX
module for backend full stack applications 1.pptx
PPTX
The Growing Popularity of AngularJS
PDF
What is Node.js_ Where, When & How To Use It.pdf
PDF
AngularJS in Production (CTO Forum)
PDF
Why Angular Development is the Future of Web Applications
PDF
7 effective reasons why you should use angular js for mobile app development
PDF
AngularJS Vs NodeJs
PDF
The Positive and Negative Aspects of Node.js Web App Development.pdf
PPT
Node js
PDF
Beginning MEAN Stack
PDF
Coders Workshop: API First Mobile Development Featuring Angular and Node
PDF
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
PDF
What is Node.js_ Pros and Cons of Node.js Web App Development.pdf
PDF
What is Node.js_ Pros and Cons of Node.js Web App Development
PDF
angularjs-vs-angular-the-key-differences-between-javascript-and-typescript
What is mean stack?
Top java script frameworks ppt
Why AngularJS is the Top Choice for Your Next Project
Node js installation steps.pptx slide share ppts
module for backend full stack applications 1.pptx
The Growing Popularity of AngularJS
What is Node.js_ Where, When & How To Use It.pdf
AngularJS in Production (CTO Forum)
Why Angular Development is the Future of Web Applications
7 effective reasons why you should use angular js for mobile app development
AngularJS Vs NodeJs
The Positive and Negative Aspects of Node.js Web App Development.pdf
Node js
Beginning MEAN Stack
Coders Workshop: API First Mobile Development Featuring Angular and Node
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
What is Node.js_ Pros and Cons of Node.js Web App Development.pdf
What is Node.js_ Pros and Cons of Node.js Web App Development
angularjs-vs-angular-the-key-differences-between-javascript-and-typescript
Ad

Recently uploaded (20)

PDF
Micro 4 New.ppt.pdf a servay of cells and microorganism
PDF
20250617 - IR - Global Guide for HR - 51 pages.pdf
PPTX
Micro1New.ppt.pptx the mai themes of micfrobiology
PDF
Computer organization and architecuture Digital Notes....pdf
PDF
Unit1 - AIML Chapter 1 concept and ethics
PPTX
chapter 1.pptx dotnet technology introduction
PDF
MACCAFERRY GUIA GAVIONES TERRAPLENES EN ESPAÑOL
PPTX
Environmental studies, Moudle 3-Environmental Pollution.pptx
PPTX
Agentic Artificial Intelligence (Agentic AI).pptx
PDF
LOW POWER CLASS AB SI POWER AMPLIFIER FOR WIRELESS MEDICAL SENSOR NETWORK
PDF
Designing Fault-Tolerant Architectures for Resilient Oracle Cloud ERP and HCM...
PDF
Project_Mgmt_Institute_-Marc Marc Marc .pdf
PDF
electrical machines course file-anna university
PDF
[jvmmeetup] next-gen integration with apache camel and quarkus.pdf
PPTX
Solar energy pdf of gitam songa hemant k
PDF
MLpara ingenieira CIVIL, meca Y AMBIENTAL
PDF
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
PPTX
Design ,Art Across Digital Realities and eXtended Reality
PPT
Programmable Logic Controller PLC and Industrial Automation
PPTX
MAD Unit - 3 User Interface and Data Management (Diploma IT)
Micro 4 New.ppt.pdf a servay of cells and microorganism
20250617 - IR - Global Guide for HR - 51 pages.pdf
Micro1New.ppt.pptx the mai themes of micfrobiology
Computer organization and architecuture Digital Notes....pdf
Unit1 - AIML Chapter 1 concept and ethics
chapter 1.pptx dotnet technology introduction
MACCAFERRY GUIA GAVIONES TERRAPLENES EN ESPAÑOL
Environmental studies, Moudle 3-Environmental Pollution.pptx
Agentic Artificial Intelligence (Agentic AI).pptx
LOW POWER CLASS AB SI POWER AMPLIFIER FOR WIRELESS MEDICAL SENSOR NETWORK
Designing Fault-Tolerant Architectures for Resilient Oracle Cloud ERP and HCM...
Project_Mgmt_Institute_-Marc Marc Marc .pdf
electrical machines course file-anna university
[jvmmeetup] next-gen integration with apache camel and quarkus.pdf
Solar energy pdf of gitam songa hemant k
MLpara ingenieira CIVIL, meca Y AMBIENTAL
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
Design ,Art Across Digital Realities and eXtended Reality
Programmable Logic Controller PLC and Industrial Automation
MAD Unit - 3 User Interface and Data Management (Diploma IT)

Mean stack Magics

  • 3. Angular js benefits over javascript........... 1. Magical Two-Way data binding. 2. Routing Support. 3.Structure front end code. 4.Templating with HTML. 5. Teach HTML new syntax with directives. 6.Embeddable, testable, and injectable. 7. Powered by Google and an active community. The angular team built a plugin for the Google chrome browser called Batarang that
  • 4. Advantages of AngularJS • AngularJS provides capability to create Single Page Application in a very clean and maintainable way. • AngularJS provides data binding capability to HTML thus giving user a rich and responsive experience • AngularJS code is unit testable. • AngularJS uses dependency injection and make use of separation of concerns.
  • 5. AngularJS provides reusable components. With AngularJS, developer write less code and get more functionality. In AngularJS, views are pure html pages, and controllers written in javascript do the business processing. On top of everything, AngularJS applications can run on all major browsers and smart phones including Android and iOS based phones/tablets.
  • 6. Disadvantages of AngulaJS • Not Secure : Being JavaScript only framework, application written in AngularJS are not safe. Server side authentication and authorization is must to keep an application secure. • Not degradable: If your application user disables Javascript then user will just see the basic page and nothing more.
  • 7. Angular JS Factory, Service and Provider • Factory • A factory is a simple function which allows you to add some logic before creating the object. It returns the created object. • Syntax app.factory('serviceName',function(){ return serviceObj; })
  • 8. Creating service using factory method <script> //creating module var app = angular.module('app', []); //define a factory using factory() function app.factory('MyFactory', function () { var serviceObj = {}; serviceObj.function1 = function () { //TO DO: }; serviceObj.function2 = function () { //TO DO: }; return serviceObj; }); </script>
  • 9. When to use It is just a collection of functions like a class. Hence, it can be instantiated in different controllers when you are using it with constructor function. Service A service is a constructor function which creates the object using new keyword. You can add properties and functions to a service object by using this keyword. Unlike factory, it doesn’t return anything. Syntax app.service('serviceName',function(){ })
  • 10. Creating service using service method 1.<script> 2.//creating module 3.var app = angular.module('app', []); 4. 5.//define a service using service() function 6.app.service('MyService', function () { 7.this.function1 = function () { 8.//TO DO: 9.}; 10. 11.this.function2 = function () { 12.//TO DO: 13.}; 14.}); 15.</script> When to use It is a singleton object. Use it when you need to share a single object across the application. For example, authenticated user details.
  • 11. Provider A provider is used to create a configurable service object. It returns value by using $get() function. Syntax //creating a service app.provider('serviceName',function(){ }); //configuring the service app.config(function(serviceNameProvider){ });
  • 12. Creating service using provider method <script> //define a provider using provider() function app.provider('configurableService', function () { var name = ''; this.setName = function (newName) { name = newName; }; this.$get = function () { return name; }; }); //configuring provider using config() function app.config(function (configurableService) { configurableService.setName('www.dotnet-tricks.com'); }); </script>
  • 13. When to use When you need to provide module-wise configuration for your service object before making it available. AngularJS : Factory, Service and Provider with example <html> <head> <title>AngularJS Service Factory and Providers</title> <script src="lib/angular.js"></script> </head> <body> <div class="container" style="padding-top:20px;"> <div ng-app="myApp" ng-controller="myController"> <p>From Service: </p> <p>From Factory: </p> <p>From Provider: </p> </div> </div> <script> //defining module var app = angular.module('myApp', []);
  • 14. //defining service app.service('myService', function () { this.name = ''; this.setName = function (newName) { this.name = newName; return this.name; }; }); //defining factory app.factory('myFactory', function () { var serviceObj = {}; serviceObj.name = ''; serviceObj.setName = function (newName) { serviceObj.name = newName; }; return serviceObj; });
  • 15. //defining provider app.provider('configurable', function () { var privateName = ''; this.setName = function (newName) { privateName = newName; }; this.$get = function () { return { name: privateName }; }; }); //configuring provider app.config(function (configurableProvider) { configurableProvider.setName("Saksham Chauhan"); });
  • 16. //defining controller app.controller('myController', function ($scope, myService, myFactory, configurable) { $scope.serviceName = myService.setName("Saksham Chauhan"); myFactory.setName("Saksham Chauhan"); $scope.factoryName = myFactory.name; $scope.providerName = configurable.name; }); </script> </body> </html>
  • 41. SaaS
  • 42. Software as a service (or SaaS) is a way of delivering applications over the Internet—as a service. Instead of installing and maintaining software, you simply access it via the Internet, freeing yourself from complex software and hardware management. SaaS applications are sometimes called Web-based software, on-demand software, or hosted software. Whatever the name, SaaS applications run on a SaaS provider’s servers. The provider manages access to the application, including security, availability, and performance.
  • 43. SAAS: THE PAYOFF SaaS customers have no hardware or software to buy, install, maintain, or update. Access to applications is easy: You just need an Internet connection. SaaS Characteristics A good way to understand the SaaS model is by thinking of a bank, which protects the privacy of each customer while providing service that is reliable and secure—on a massive scale. A bank’s customers all use the same financial systems and technology without worrying about anyone accessing their personal information without authorization.
  • 44. A “bank” meets the key characteristics of the SaaS model: MULTITENANT ARCHITECTURE A multitenant architecture, in which all users and applications share a single, common infrastructure and code base that is centrally maintained. Because SaaS vendor clients are all on the same infrastructure and code base, vendors can innovate more quickly and save the valuable development time previously spent on maintaining numerous versions of outdated code. EASY CUSTOMIZATION The ability for each user to easily customize applications to fit their business processes without affecting the common infrastructure. Because of the way SaaS is architected, these customizations are unique to each company or user and are always preserved through upgrades. That means SaaS providers can make upgrades more often, with less customer risk and much lower adoption cost.
  • 45. BETTER ACCESS Improved access to data from any networked device while making it easier to manage privileges, monitor data use, and ensure everyone sees the same information at the same time. SAAS HARNESSES THE CONSUMER WEB Anyone familiar with Amazon.com or My Yahoo! will be familiar with the Web interface of typical SaaS applications. With the SaaS model, you can customize with point-and-click ease, making the weeks or months it takes to update traditional business software seem hopelessly old fashioned. SAAS TRENDS Organizations are now developing SaaS integration platforms (or SIPs) for building additional SaaS applications. The consulting firm Saugatuck Technology calls this the “third wave” in software adoption: when SaaS moves beyond standalone software functionality to become a platform for mission-critical applications.
  • 47. What is Nodejs? • Node.js is a server side scripting platform just like php, python or ruby. • Php depends on Apache or nginx web servers for handling http request and response, on the other hand Node.js has its own http server library allowing us to have more control on the web server.
  • 48. Definition of Node • Node.js is built on Chrome’s JavaScript runtime V8 for developing fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
  • 49. Advantages of node.js • Node.js uses java script and it is easy to learn. • Node.js runs on v8 Engine (a javascript interpreter: chrome uses it) which is very fast. • We can build highly scalable web applications using node.js • We can develop chat based applications, online games, API’s and many more. • Supports interaction with all major databases. • Node.js has 1000’s of third-party free modules.
  • 50. Companies depending on node.js • ebay, Microsoft, Yahoo!, StrongLoop, OmniTI, Storify, local response, nodejitsu, Linkedin, Iris Couch, backbeam, recruitics, Transloadit, Uber, Voxer,when-to- manage, Jaleoo, Cloud9 IDE, NODE the FIRM etc..
  • 51. Basic terminology • Asynchronous– Asynchronous means an event which is happening independently of other events. The main advantage of the asynchronous approach is scalability. • Npm – Stands for node package manager. This will help us install the latest modules directly from the servers instead of checking for the latest version, downloading and copying to the appropriate directory. It also has other uses.
  • 52. Express– Express is a highly recommended web application framework for node.js. It takes care of the low level services for us. Module– A module is a independent, reusable piece of code. you can download them and use them directly in your project. ex: express, http, https etc are some of the modules for node.js. REPL-Read-Eval-Print-Loop provides a way to interact with javascript it can be used for debugging, testing. To try repl go to terminal(cmd prompt) and type node and try ex: console.log(“learn nodejs”); Mongoose– Mongoose is a MongoDB object modeling tool for node.js. It becomes easy to interact with mongodb database server using Mongoose module. Db-mysql– It is a node.js module to interact with mysql database.
  • 53. Advantages of Node.js • Open Source • Node.js is open source, so it’s free to use and no need to pay for license. There are also many open source modules supported by Node.js. • JavaScript as Programming Language • It uses JavaScript as a programming language for both front-end and back-end which increase programmer productivity and code reusability.
  • 54. • Scalable • You can scale your Node.js application by using two ways – Horizontal Scaling and Vertical Scaling, which helps you to improve your application performance. – In Horizontal scaling you can add more nodes to your existing system. – In Vertical scaling you can add more resources to a single node. • Better Performance • It provides better performance, since Node.js I/O operations are non-blocking. Also, it uses V8 JavaScript engine to execute JavaScript code. V8 engine compiles the JS code directly into machine code which make it fast.
  • 55. • Caching Support • Node.js supports caching of modules. Hence, when a Node.js modules is requested first time, it is cached into the application memory. So next calls for loading the same module may not cause the module code to be executed again. • Lightweight and Extensible • Node.js is based on JavaScript which can be executed on client side as well as server side. Also, it supports exchange of data using JSON which is easily consumed by JavaScript. This makes it light weight as compared to other frameworks. • Node.js is open source. Hence you can extend it as per your need.
  • 56. • REST API Support • Using Node.js you can also develop RESTful services API easily. • Unit Testing • It supports unit testing out of box. You can use any JS unit testing frameworks like Jasmin to test your Node.js code. • Server Development • Node.js has some built-in API which help you to create different types of Server like HTTP Server, DNS Server, TCP Server etc. • Community Support • Node.js has a wide community of developers around the world. They are active in development of new modules or packages to support different types of applications development.
  • 57. Limitations of Node.js • It doesn’t support multi-threaded programming. • It doesn’t support very high computational intensive tasks. When it executes long running task, it will queue all the incoming requests to wait for execution, since it follows JavaScript event loop which is single threaded. • Node good for executing synchronous and CPU intensive tasks.
  • 58. MongoDB • MongoDB is a cross-platform, document oriented database that provides, high performance, high availability, and easy scalability. MongoDB works on concept of collection and document.
  • 59. Advantages of MongoDB over RDBMS • Schema less : MongoDB is document database in which one collection holds different different documents. Number of fields, content and size of the document can be differ from one document to another. • Structure of a single object is clear • No complex joins
  • 60. • Deep query-ability. MongoDB supports dynamic queries on documents using a document-based query language that's nearly as powerful as SQL • Tuning • Ease of scale-out: MongoDB is easy to scale • Conversion / mapping of application objects to database objects not needed • Uses internal memory for storing the (windowed) working set, enabling faster access of data
  • 61. Why should use MongoDB? • Document Oriented Storage : Data is stored in the form of JSON style documents • Index on any attribute • Replication & High Availability • Auto-Sharding • Rich Queries • Fast In-Place Updates • Professional Support By MongoDB
  • 62. Disadvantages of MDB • Data size in MongoDB is typically higher due to e.g. each document has field names stored it • less flexibity with querying (e.g. no JOINs) • no support for transactions - certain atomic operations are supported, at a single document level • at the moment Map/Reduce (e.g. to do aggregations/data analysis) is OK, but not blisteringly fast. So if that's required, something like Hadoop may need to be added into the mix • less up to date information available/fast evolving product
  • 65. • MEAN stack stands for • MongoDB as a Database • Express as the Web Framework • AngularJS as a frontend framework and • js as the server platform. • There are various Advantages of using Mean Stack: • You are free to use Mongo DB • Its cost effective • You will get benefited by using MongoDB • MEAN stack uses JSON • Node.js simplifies the server layer and is super- fast
  • 66. JAVASCRIPT Advantages • Javascript is executed on the client side This means that the code is executed on the user's processor instead of the web server thus saving bandwidth and strain on the web server. • Javascript is a relatively easy language The Javascript language is relatively easy to learn and comprises of syntax that is close to English. It uses the DOM model that provides plenty of prewritten functionality to the various objects on pages making it a breeze to develop a script to solve a custom purpose.
  • 67. • Javascript is relatively fast to the end user As the code is executed on the user's computer, results and processing is completed almost instantly depending on the task (tasks in javascript on web pages are usually simple so as to prevent being a memory hog) as it does not need to be processed in the site's web server and sent back to the user consuming local as well as server bandwidth. • Extended functionality to web pages Third party add-ons like Greasemonkey enable Javascript developers to write snippets of Javascript which can execute on desired web pages to extend its functionality. If you use a website and require a certain feature to be included, you can write it yourself and use an add-on like Greasemonkey to implement it on the web page.
  • 68. Disadvantages • Security Issues Javascript snippets, once appended onto web pages execute on client servers immediately and therefore can also be used to exploit the user's system. While a certain restriction is set by modern web standards on browsers, malicious code can still be executed complying with the restrictions set. • Javascript rendering varies Different layout engines may render Javascript differently resulting in inconsistency in terms of functionality and interface. While the latest versions of javascript and rendering have been geared towards a universal standard, certain variations still exist. Website Usability Consultants all over the world make a living on these differences, but it enrages thousands of developers on a daily basis.
  • 69. Express.js • Express is a fast, unopinionated minimalist web framework for Node.js" - official web site: Expressjs.com • Express.js is a web application framework for Node.js. It provides various features that make web application development fast and easy which otherwise takes more time using only Node.js.
  • 70. • Express.js is based on the Node.js middleware module called connect which in turn uses http module. So, any middleware which is based on connect will also work with Express.js.
  • 71. Advantages of Express • Makes Node.js web application development fast and easy. • Easy to configure and customize. • Allows you to define routes of your application based on HTTP methods and URLs. • Includes various middleware modules which you can use to perform additional tasks on request and response. • Easy to integrate with different template engines like Jade, Vash, EJS etc. • Allows you to define an error handling middleware. • Easy to serve static files and resources of your application. • Allows you to create REST API server. • Easy to connect with databases such as MongoDB, Redis, MySQL
  • 72. Express.js Web Application: • Express.js provides an easy way to create web server and render HTML pages for different HTTP requests by configuring routes for your application. • Configure Routes: Use app object to define different routes of your application. The app object includes get(), post(), put() and delete() methods to define routes for HTTP GET, POST, PUT and DELETE requests respectively.
  • 73. Body Parser: • To handle HTTP POST request in Express.js version 4 and above, you need to install middleware module called body-parser. The middleware was a part of Express.js earlier but now you have to install it separately. • This body-parser module parses the JSON, buffer, string and url encoded data submitted using HTTP POST request.
  • 74. Gulp Vs Grunt • The biggest advantage of using gulp is that it focuses on code whereas grunt relies on configuration. Personally, I have always been a fan of code over configuration. • Gulp is a streaming build system. It utilises Node.js streams and usually executes faster than grunt. • In reality, gulp plugins are just Node.js streaming modules that have nothing to do with gulp (except the name, of course). • Gulp plugins follow the unix principle : Try to do one thing well. • If you are a beginner, you will probably pick up gulp faster than grunt because of code over configuration.
  • 75. •Grunt focuses on configuration, while Gulp focuses on code •Grunt was built around a set of built-in, and commonly used tasks, while Gulp came around with the idea of enforcing nothing, but how community-developed micro- tasks should connect to each other.
  • 76. Similarities between Grunt and Gulp Grunt and Gulp can automate tedious, human-error-prone build processes such as: •code minification. •code-quality analysis •image optimization •vendor-prefixing •unit-testing
  • 77. Differences between Grunt and Gulp • The way you configure your tasks. Grunt is configuration-based. Gulp is stream-based. • The way they run your tasks. Grunt runs the processes you want to execute in a sequential manner. Gulp tries to run them with maximum concurrency, meaning it will try to execute processes in parallel if possible.