SlideShare a Scribd company logo
Building an End-to-End
AngularJS Application
Dan Wahlin
Building an End-to-End AngularJS Application
Building an End-to-End AngularJS Application






The Customer Manager App
Building an End-to-End AngularJS Application
http://tinyurl.com/CustomerMgr
Application Technologies
Node.js
Express
MongoDB
ASP.NET
Web API
SQL Server
/api/dataservice/
ngAnimate Bootstrap
AngularJS
ngRoute UI Bootstrap
Optional
Breeze jQuery GreenSock
Application and Code
Structure
Building an End-to-End AngularJS Application








Building an End-to-End AngularJS Application
Building an End-to-End AngularJS Application
angular.module('customersApp').controller('MyController',
['$scope', function ($scope) {
$scope.orderby = 'product';
$scope.reverse = false;
$scope.ordersTotal = 0.00;
$scope.setOrder = function (orderby) { … };
}]);
(function() {
var myController = function ($scope) {
$scope.orderby = 'product';
$scope.reverse = false;
$scope.ordersTotal = 0.00;
$scope.setOrder = function (orderby) { … };
init();
function init() { … }
};
myController.$inject = ['$scope'];
angular.module('customersApp'.controller('MyController',
myController);
}());
Focus on your code
Handle minification
Hook function into
AngularjS
Creating Factories and
Services
customersService modalService
customersBreezeService
Controllers/Directives
Show Modal DialogWork with Data
authService
(function () {
var customersService = function ($http, $q) {
var serviceBase = '/api/dataservice/',
customersFactory = {};
customersFactory.getCustomers = function (pageIndex,
pageSize) {
return getPagedResource('customers', pageIndex,
pageSize);
};
return customersFactory;
};
customersService.$inject = ['$http', '$q'];
angular.module('customersService')
.factory('customersService' customersService);
}());
Uses $http to call
RESTful service
(function () {
var authFactory = function ($http, $q, $rootScope) {
var serviceBase = '/api/dataservice/',
factory = {
loginPath: '/login',
user: { isAuthenticated: false }
};
factory.login = function (email, password) { };
factory.logout = function () { };
return factory;
};
authFactory.$inject = ['$http', '$q', '$rootScope'];
angular.module('customersApp')
.factory('authService', authFactory);
}());
(function () {
var modalService = function ($modal) {
this.showModal = function (customModalDefaults,
customModalOptions) { … };
this.show = function (customModalDefaults,
customModalOptions) {
return $modal.open(tempModalDefaults).result;
};
};
modalService.$inject = ['$modal'];
angular.module('customersApp'.service('modalService',
modalService]);
}());
Provider from UI Bootstrap
Directives and Filters
Directives
wcOverlay
wcUnique
Filters
nameCityStateFilter
nameProductFilter





var wcDirectivesApp = angular.module('wc.directives', []);
//Empty factory to hook into $httpProvider.interceptors
//Directive will hookup request, response, and responseError
interceptors
wcDirectivesApp.factory('httpInterceptor', function () {
return {};
});
//Hook httpInterceptor factory into the $httpProvider interceptors
so that we can monitor XHR calls
wcDirectivesApp.config(['$httpProvider', function ($httpProvider) {
$httpProvider.interceptors.push('httpInterceptor');
}]);
function wireUpHttpInterceptor() {
httpInterceptor.request = function (config) {
processRequest();
return config || $q.when(config);
};
httpInterceptor.response = function (response) {
processResponse();
return response || $q.when(response);
};
httpInterceptor.responseError = function (rejection) {
processResponse();
return rejection || $q.when(rejection);
};
}
httpInterceptor injected
into Directive



if (currentValue === element.val()) {
ngModel.$setValidity('unique', unique);
}






<div data-ng-repeat="customer in customers |
nameProductFilter:searchText | orderBy:'lastName'">
…
</div>

function filterCustomers(filterText) {
$scope.filteredCustomers =
$filter("nameCityStateFilter")($scope.customers, filterText);
$scope.filteredCount = $scope.filteredCustomers.length;
}
Controllers and Views













<div data-ng-view="" id="ng-view"
class="slide-animation"></div>

<div data-wc-overlay="" data-wc-overlay-delay="300">
<img src="/Content/images/spinner.gif"/>
&nbsp;&nbsp;Loading
</div>
customersApp.config(['$routeProvider', function ($routeProvider) {
$routeProvider
.when('/customers', {
controller: 'CustomersController',
templateUrl: '/app/views/customers/customers.html'
})
.when('/customerorders/:customerID', {
controller: 'CustomerOrdersController',
templateUrl: '/app/views/customers/customerOrders.html'
})
.when('/customeredit/:customerID', {
controller: 'CustomerEditController',
templateUrl: '/app/views/customers/customerEdit.html'
})
.when('/orders', {
controller: 'OrdersController',
templateUrl: '/app/views/orders/orders.html'
})
.otherwise({ redirectTo: '/customers' });
}]);














http://weblogs.asp.net/dwahlin
Building an End-to-End AngularJS Application
Building an End-to-End AngularJS Application
Ad

Recommended

Angular js routing options
Angular js routing options
Nir Kaufman
 
AngularJS in 60ish Minutes
AngularJS in 60ish Minutes
Dan Wahlin
 
Practical AngularJS
Practical AngularJS
Wei Ru
 
AngularJS Directives
AngularJS Directives
Eyal Vardi
 
Architecture, Auth, and Routing with uiRouter
Architecture, Auth, and Routing with uiRouter
Christopher Caplinger
 
How routing works in angular js
How routing works in angular js
codeandyou forums
 
AngularJS Internal
AngularJS Internal
Eyal Vardi
 
AngularJS Routing
AngularJS Routing
Eyal Vardi
 
Angular JS blog tutorial
Angular JS blog tutorial
Claude Tech
 
Why angular js Framework
Why angular js Framework
Sakthi Bro
 
Angular js architecture (v1.4.8)
Angular js architecture (v1.4.8)
Gabi Costel Lapusneanu
 
AngularJS Framework
AngularJS Framework
Barcamp Saigon
 
AngularJS $Provide Service
AngularJS $Provide Service
Eyal Vardi
 
AngularJS Architecture
AngularJS Architecture
Eyal Vardi
 
Built in filters
Built in filters
Brajesh Yadav
 
AngularJs
AngularJs
syam kumar kk
 
Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JS
Simon Guest
 
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
Eyal Vardi
 
Building AngularJS Custom Directives
Building AngularJS Custom Directives
Dan Wahlin
 
UI-Router
UI-Router
Loc Nguyen
 
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and Navigation
Eyal Vardi
 
Patterns Are Good For Managers
Patterns Are Good For Managers
AgileThought
 
Modules and injector
Modules and injector
Eyal Vardi
 
Intro to Angular.JS Directives
Intro to Angular.JS Directives
Christian Lilley
 
Angular Promises and Advanced Routing
Angular Promises and Advanced Routing
Alexe Bogdan
 
Filters in AngularJS
Filters in AngularJS
Brajesh Yadav
 
AngularJS Compile Process
AngularJS Compile Process
Eyal Vardi
 
Dart and AngularDart
Dart and AngularDart
Loc Nguyen
 
AngularJS.part1
AngularJS.part1
Andrey Kolodnitsky
 
Angular Workshop_Sarajevo2
Angular Workshop_Sarajevo2
Christoffer Noring
 

More Related Content

What's hot (20)

Angular JS blog tutorial
Angular JS blog tutorial
Claude Tech
 
Why angular js Framework
Why angular js Framework
Sakthi Bro
 
Angular js architecture (v1.4.8)
Angular js architecture (v1.4.8)
Gabi Costel Lapusneanu
 
AngularJS Framework
AngularJS Framework
Barcamp Saigon
 
AngularJS $Provide Service
AngularJS $Provide Service
Eyal Vardi
 
AngularJS Architecture
AngularJS Architecture
Eyal Vardi
 
Built in filters
Built in filters
Brajesh Yadav
 
AngularJs
AngularJs
syam kumar kk
 
Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JS
Simon Guest
 
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
Eyal Vardi
 
Building AngularJS Custom Directives
Building AngularJS Custom Directives
Dan Wahlin
 
UI-Router
UI-Router
Loc Nguyen
 
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and Navigation
Eyal Vardi
 
Patterns Are Good For Managers
Patterns Are Good For Managers
AgileThought
 
Modules and injector
Modules and injector
Eyal Vardi
 
Intro to Angular.JS Directives
Intro to Angular.JS Directives
Christian Lilley
 
Angular Promises and Advanced Routing
Angular Promises and Advanced Routing
Alexe Bogdan
 
Filters in AngularJS
Filters in AngularJS
Brajesh Yadav
 
AngularJS Compile Process
AngularJS Compile Process
Eyal Vardi
 
Dart and AngularDart
Dart and AngularDart
Loc Nguyen
 
Angular JS blog tutorial
Angular JS blog tutorial
Claude Tech
 
Why angular js Framework
Why angular js Framework
Sakthi Bro
 
AngularJS $Provide Service
AngularJS $Provide Service
Eyal Vardi
 
AngularJS Architecture
AngularJS Architecture
Eyal Vardi
 
Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JS
Simon Guest
 
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
Eyal Vardi
 
Building AngularJS Custom Directives
Building AngularJS Custom Directives
Dan Wahlin
 
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and Navigation
Eyal Vardi
 
Patterns Are Good For Managers
Patterns Are Good For Managers
AgileThought
 
Modules and injector
Modules and injector
Eyal Vardi
 
Intro to Angular.JS Directives
Intro to Angular.JS Directives
Christian Lilley
 
Angular Promises and Advanced Routing
Angular Promises and Advanced Routing
Alexe Bogdan
 
Filters in AngularJS
Filters in AngularJS
Brajesh Yadav
 
AngularJS Compile Process
AngularJS Compile Process
Eyal Vardi
 
Dart and AngularDart
Dart and AngularDart
Loc Nguyen
 

Similar to Building an End-to-End AngularJS Application (20)

AngularJS.part1
AngularJS.part1
Andrey Kolodnitsky
 
Angular Workshop_Sarajevo2
Angular Workshop_Sarajevo2
Christoffer Noring
 
AngularJS and SPA
AngularJS and SPA
Lorenzo Dematté
 
Angular js 1.0-fundamentals
Angular js 1.0-fundamentals
Venkatesh Narayanan
 
AngularJS = Browser applications on steroids
AngularJS = Browser applications on steroids
Maurice De Beijer [MVP]
 
Angular server-side communication
Angular server-side communication
Alexe Bogdan
 
AngularJS
AngularJS
Maurice De Beijer [MVP]
 
Basics of AngularJS
Basics of AngularJS
Filip Janevski
 
AngularJs-training
AngularJs-training
Pratchaya Suputsopon
 
Javascript Frameworks for Well Architected, Immersive Web Apps
Javascript Frameworks for Well Architected, Immersive Web Apps
dnelson-cs
 
AngularJs Crash Course
AngularJs Crash Course
Keith Bloomfield
 
Introduction to AngularJS
Introduction to AngularJS
Anass90
 
Angular.js is super cool
Angular.js is super cool
Maksym Hopei
 
An Introduction to AngularJS
An Introduction to AngularJS
Falk Hartmann
 
Angular js training in pune course content By Advanto Software
Angular js training in pune course content By Advanto Software
Advanto Software
 
Workshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte II
Visual Engineering
 
Angular Presentation
Angular Presentation
Adam Moore
 
Introduction to AngularJs
Introduction to AngularJs
murtazahaveliwala
 
01 startoff angularjs
01 startoff angularjs
Erhwen Kuo
 
Intro to AngularJs
Intro to AngularJs
SolTech, Inc.
 
AngularJS = Browser applications on steroids
AngularJS = Browser applications on steroids
Maurice De Beijer [MVP]
 
Angular server-side communication
Angular server-side communication
Alexe Bogdan
 
Javascript Frameworks for Well Architected, Immersive Web Apps
Javascript Frameworks for Well Architected, Immersive Web Apps
dnelson-cs
 
Introduction to AngularJS
Introduction to AngularJS
Anass90
 
Angular.js is super cool
Angular.js is super cool
Maksym Hopei
 
An Introduction to AngularJS
An Introduction to AngularJS
Falk Hartmann
 
Angular js training in pune course content By Advanto Software
Angular js training in pune course content By Advanto Software
Advanto Software
 
Workshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte II
Visual Engineering
 
Angular Presentation
Angular Presentation
Adam Moore
 
01 startoff angularjs
01 startoff angularjs
Erhwen Kuo
 
Ad

More from Dan Wahlin (7)

Development Trends - What's New in the World of Web Development
Development Trends - What's New in the World of Web Development
Dan Wahlin
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Dan Wahlin
 
JavaScript Patterns to Cleanup your Code
JavaScript Patterns to Cleanup your Code
Dan Wahlin
 
Getting Started Building Windows 8 HTML/JavaScript Metro Apps
Getting Started Building Windows 8 HTML/JavaScript Metro Apps
Dan Wahlin
 
Using jQuery Templates
Using jQuery Templates
Dan Wahlin
 
Integrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight Applications
Dan Wahlin
 
Getting Started with ASP.NET MVC 3 and Razor
Getting Started with ASP.NET MVC 3 and Razor
Dan Wahlin
 
Development Trends - What's New in the World of Web Development
Development Trends - What's New in the World of Web Development
Dan Wahlin
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Dan Wahlin
 
JavaScript Patterns to Cleanup your Code
JavaScript Patterns to Cleanup your Code
Dan Wahlin
 
Getting Started Building Windows 8 HTML/JavaScript Metro Apps
Getting Started Building Windows 8 HTML/JavaScript Metro Apps
Dan Wahlin
 
Using jQuery Templates
Using jQuery Templates
Dan Wahlin
 
Integrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight Applications
Dan Wahlin
 
Getting Started with ASP.NET MVC 3 and Razor
Getting Started with ASP.NET MVC 3 and Razor
Dan Wahlin
 
Ad

Recently uploaded (20)

“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
Edge AI and Vision Alliance
 
June Patch Tuesday
June Patch Tuesday
Ivanti
 
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
Edge AI and Vision Alliance
 
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Alliance
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
Safe Software
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
Edge AI and Vision Alliance
 
June Patch Tuesday
June Patch Tuesday
Ivanti
 
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
“From Enterprise to Makers: Driving Vision AI Innovation at the Extreme Edge,...
Edge AI and Vision Alliance
 
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Alliance
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
Safe Software
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 

Building an End-to-End AngularJS Application

Editor's Notes

  • #38: &lt;divclass=&quot;error-container&quot;ng-show=&quot;signup_form.username.$dirty &amp;&amp; signup_form.username.$invalid&quot;&gt;&lt;smallclass=&quot;error&quot;ng-show=&quot;signup_form.username.$error.required&quot;&gt;Please input a username&lt;/small&gt;&lt;smallclass=&quot;error&quot;ng-show=&quot;signup_form.username.$error.minlength&quot;&gt;Your username is required to be at least 3 characters&lt;/small&gt;&lt;smallclass=&quot;error&quot;ng-show=&quot;signup_form.username.$error.maxlength&quot;&gt;Your username cannot be longer than 20 characters&lt;/small&gt;&lt;smallclass=&quot;error&quot;ng-show=&quot;signup_form.username.$error.unique&quot;&gt;That username is taken, please try another&lt;/small&gt;&lt;/div&gt;