SlideShare a Scribd company logo
What is Angular?
• Client side MVC Framework
• Templating Engine
• So Much More
Client Side MVC
• Model is a JavaScript object
• View is HTML with AngularJS directives
• Controller is a JavaScript class
Templating Engine
• Part of the Two – Way Data Binding
• Implemented Through Directives
• UI is Updated as the Model Changes
• Model is Updated as the UI Changes
A Very Simple Example
• Install AngularJS
• Install-Package angularjs
• Add Script reference at the bottom
• <script src="~/Scripts/angular.js"></script>
• Calculate LTV for a Mortgage
Revisit the jQuery Fast Food Site
• New Controller called AngularController
• Three Samples
• Calculate LTV
• Calculate a Payment
• Apply
AngularController
Simply Returns an Empty View
public ActionResult MortgageCalculator()
{
return View();
}
Setting Up the View
<div ng-app
ng-init="loanAmount=150000;appraisedValue=180000">
Tell Angular to start and initialize some data.
ng-init rarely used except in simple scenarios.
Basic Binding and Simple Expressions
ng-model="loanAmount“
ng-model="appraisedValue“
{{(loanAmount/appraisedValue)*100| number:3}}
Adding a Controller
<div ng-app="mortgageCalculator">
<div ng-controller="calculatorController">
var myApp = angular.module('mortgageCalculator', []);
myApp.controller("calculatorController", [
Initializing Scope
"$scope", function($scope) {
$scope.title = "calculatorController";
$scope.amount = 100000;
$scope.term = 30;
$scope.rate = 4.5;
Declaring a Function
$scope.calculatePayment = function () {
var effectiveRate = ($scope.rate / 100) / 12;
var numberOfMonths = $scope.term * 12;
var numerator = effectiveRate * Math.pow(effectiveRate + 1, numberOfMonths);
var denominator = Math.pow(1 + effectiveRate, numberOfMonths) - 1;
$scope.payment = $scope.amount * (numerator / denominator);
};
Calling the Function
<div class="col-md-10">
<button ng-click="calculatePayment()" class="btn btn-default">
Calculate Payment
<span class=" glyphicon glyphicon-cog ">
</span>
</button>
</div>
Declaring a Function (part 2)
<input type="number" min="0" ng-model="amount" ng-
change="calculatePayment()" class="form-control text-box
single-line">
Angular and Razor
@Html.LabelFor(model => model.Borrower, htmlAttributes:
new { @class = "control-label col-md-2"})
<div class="col-md-10">
@Html.TextBoxFor(model => model.Borrower, htmlAttributes: new {
@class = "form-control ", ng_model = "Names.Borrower" })
</div>
Angular and Razor
<div id="borrowerPanel" class="panel-collapse collapse in">
<div class="panel-body">
@Html.Partial("NamesEditor")
</div>
</div>
Angular and Razor
• Attributes

More Related Content

What's hot

AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
Nikita Shounewich
 
Building single page applications with angular.js
Building single page applications with angular.jsBuilding single page applications with angular.js
Building single page applications with angular.js
Dieter De Mesmaeker
 
angularJS Practicle Explanation
angularJS Practicle ExplanationangularJS Practicle Explanation
angularJS Practicle Explanation
Abhishek Sahu
 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - Introduction
Senthil Kumar
 
AngularJS Beginners Workshop
AngularJS Beginners WorkshopAngularJS Beginners Workshop
AngularJS Beginners Workshop
Sathish VJ
 
AngularJS is awesome
AngularJS is awesomeAngularJS is awesome
AngularJS is awesome
Eusebiu Schipor
 
ASP.NET MVC and ajax
ASP.NET MVC and ajax ASP.NET MVC and ajax
ASP.NET MVC and ajax
Brij Mishra
 
How angularjs saves rails
How angularjs saves railsHow angularjs saves rails
How angularjs saves rails
Michael He
 
Introduction to React, Flux, and Isomorphic Apps
Introduction to React, Flux, and Isomorphic AppsIntroduction to React, Flux, and Isomorphic Apps
Introduction to React, Flux, and Isomorphic Apps
Federico Torre
 
React vs angular (mobile first battle)
React vs angular (mobile first battle)React vs angular (mobile first battle)
React vs angular (mobile first battle)
Michael Haberman
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular js
Mindfire Solutions
 
AngularJS meets Rails
AngularJS meets RailsAngularJS meets Rails
AngularJS meets Rails
Elena Torró
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
Narek Mamikonyan
 
Integrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business WorkflowIntegrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business Workflow
Yakov Fain
 
Angularjs basic part01
Angularjs basic part01Angularjs basic part01
Angularjs basic part01
Mohd Abdul Baquee
 
Angular js for beginners
Angular js for beginnersAngular js for beginners
Angular js for beginners
Munir Hoque
 
ASP .NET MVC - best practices
ASP .NET MVC - best practicesASP .NET MVC - best practices
ASP .NET MVC - best practices
Bohdan Pashkovskyi
 
Angular JS tutorial
Angular JS tutorialAngular JS tutorial
Angular JS tutorial
cncwebworld
 
Creating asynchronous flows on AWS
Creating asynchronous flows on AWSCreating asynchronous flows on AWS
Creating asynchronous flows on AWS
Metin Kale
 
React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UI
Marcin Grzywaczewski
 

What's hot (20)

AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
 
Building single page applications with angular.js
Building single page applications with angular.jsBuilding single page applications with angular.js
Building single page applications with angular.js
 
angularJS Practicle Explanation
angularJS Practicle ExplanationangularJS Practicle Explanation
angularJS Practicle Explanation
 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - Introduction
 
AngularJS Beginners Workshop
AngularJS Beginners WorkshopAngularJS Beginners Workshop
AngularJS Beginners Workshop
 
AngularJS is awesome
AngularJS is awesomeAngularJS is awesome
AngularJS is awesome
 
ASP.NET MVC and ajax
ASP.NET MVC and ajax ASP.NET MVC and ajax
ASP.NET MVC and ajax
 
How angularjs saves rails
How angularjs saves railsHow angularjs saves rails
How angularjs saves rails
 
Introduction to React, Flux, and Isomorphic Apps
Introduction to React, Flux, and Isomorphic AppsIntroduction to React, Flux, and Isomorphic Apps
Introduction to React, Flux, and Isomorphic Apps
 
React vs angular (mobile first battle)
React vs angular (mobile first battle)React vs angular (mobile first battle)
React vs angular (mobile first battle)
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular js
 
AngularJS meets Rails
AngularJS meets RailsAngularJS meets Rails
AngularJS meets Rails
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
 
Integrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business WorkflowIntegrating consumers IoT devices into Business Workflow
Integrating consumers IoT devices into Business Workflow
 
Angularjs basic part01
Angularjs basic part01Angularjs basic part01
Angularjs basic part01
 
Angular js for beginners
Angular js for beginnersAngular js for beginners
Angular js for beginners
 
ASP .NET MVC - best practices
ASP .NET MVC - best practicesASP .NET MVC - best practices
ASP .NET MVC - best practices
 
Angular JS tutorial
Angular JS tutorialAngular JS tutorial
Angular JS tutorial
 
Creating asynchronous flows on AWS
Creating asynchronous flows on AWSCreating asynchronous flows on AWS
Creating asynchronous flows on AWS
 
React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UI
 

Viewers also liked

Corporate Members Event June 2015
Corporate Members Event June 2015Corporate Members Event June 2015
Corporate Members Event June 2015
British Institute of Facilities Management
 
2015 kick off meeting
2015 kick off meeting2015 kick off meeting
2015 kick off meeting
Columbia Developers Guild
 
Algorithms for programers
Algorithms for programersAlgorithms for programers
Algorithms for programers
Ricardo Garcia
 
BIM - the FM Perspective, BIFM
BIM - the FM Perspective, BIFMBIM - the FM Perspective, BIFM
BIM - the FM Perspective, BIFM
British Institute of Facilities Management
 
Financial Education At Work 2014
Financial Education At Work 2014Financial Education At Work 2014
Financial Education At Work 2014
James Ker-Reid
 
UBS, Building Information Modelling
UBS, Building Information ModellingUBS, Building Information Modelling
UBS, Building Information Modelling
British Institute of Facilities Management
 
Unobtrusive javascript
Unobtrusive javascriptUnobtrusive javascript
Unobtrusive javascript
Columbia Developers Guild
 
Evolution of java script libraries
Evolution of java script librariesEvolution of java script libraries
Evolution of java script libraries
Columbia Developers Guild
 
BIM from an FM perspective
BIM from an FM perspectiveBIM from an FM perspective
BIM from an FM perspective
British Institute of Facilities Management
 
Comparación del diagnóstico de lesiones de caries en la dentición decidua con...
Comparación del diagnóstico de lesiones de caries en la dentición decidua con...Comparación del diagnóstico de lesiones de caries en la dentición decidua con...
Comparación del diagnóstico de lesiones de caries en la dentición decidua con...
Escuela de Estomatología Universidad Científica del Sur
 
FSI Global - CAFM systems
FSI Global - CAFM systemsFSI Global - CAFM systems
Factores de riesgo asociados a la prevalencia de caries de aparición temprana...
Factores de riesgo asociados a la prevalencia de caries de aparición temprana...Factores de riesgo asociados a la prevalencia de caries de aparición temprana...
Factores de riesgo asociados a la prevalencia de caries de aparición temprana...
Escuela de Estomatología Universidad Científica del Sur
 
Caso clínico final
Caso clínico finalCaso clínico final

Viewers also liked (13)

Corporate Members Event June 2015
Corporate Members Event June 2015Corporate Members Event June 2015
Corporate Members Event June 2015
 
2015 kick off meeting
2015 kick off meeting2015 kick off meeting
2015 kick off meeting
 
Algorithms for programers
Algorithms for programersAlgorithms for programers
Algorithms for programers
 
BIM - the FM Perspective, BIFM
BIM - the FM Perspective, BIFMBIM - the FM Perspective, BIFM
BIM - the FM Perspective, BIFM
 
Financial Education At Work 2014
Financial Education At Work 2014Financial Education At Work 2014
Financial Education At Work 2014
 
UBS, Building Information Modelling
UBS, Building Information ModellingUBS, Building Information Modelling
UBS, Building Information Modelling
 
Unobtrusive javascript
Unobtrusive javascriptUnobtrusive javascript
Unobtrusive javascript
 
Evolution of java script libraries
Evolution of java script librariesEvolution of java script libraries
Evolution of java script libraries
 
BIM from an FM perspective
BIM from an FM perspectiveBIM from an FM perspective
BIM from an FM perspective
 
Comparación del diagnóstico de lesiones de caries en la dentición decidua con...
Comparación del diagnóstico de lesiones de caries en la dentición decidua con...Comparación del diagnóstico de lesiones de caries en la dentición decidua con...
Comparación del diagnóstico de lesiones de caries en la dentición decidua con...
 
FSI Global - CAFM systems
FSI Global - CAFM systemsFSI Global - CAFM systems
FSI Global - CAFM systems
 
Factores de riesgo asociados a la prevalencia de caries de aparición temprana...
Factores de riesgo asociados a la prevalencia de caries de aparición temprana...Factores de riesgo asociados a la prevalencia de caries de aparición temprana...
Factores de riesgo asociados a la prevalencia de caries de aparición temprana...
 
Caso clínico final
Caso clínico finalCaso clínico final
Caso clínico final
 

Similar to Introducing angular

AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
Raghubir Singh
 
Angularjs
AngularjsAngularjs
Angularjs
Sabin Tamrakar
 
Angular js - the beginning
Angular js - the beginningAngular js - the beginning
Angular js - the beginning
A.K.M. Ahsrafuzzaman
 
Angular js for Beginnners
Angular js for BeginnnersAngular js for Beginnners
Angular js for Beginnners
Santosh Kumar Kar
 
AngularJs Basic Concept
AngularJs Basic ConceptAngularJs Basic Concept
AngularJs Basic Concept
Hari Haran
 
Controllers in AngularJs
Controllers in AngularJsControllers in AngularJs
Controllers in AngularJs
K Arunkumar
 
AngularJS Framework
AngularJS FrameworkAngularJS Framework
AngularJS Framework
Barcamp Saigon
 
AngularJS Framework
AngularJS FrameworkAngularJS Framework
AngularJS Framework
CloudVis Technology
 
AangularJS Framework
AangularJS FrameworkAangularJS Framework
AangularJS Framework
CloudVis Technology
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
Gaurav Agrawal
 
Angular js anupama
Angular js anupamaAngular js anupama
Angular js anupama
Anupama Prabhudesai
 
AngularJS
AngularJSAngularJS
AngularJS
Mahmoud Tolba
 
AgularJS basics- angular directives and controllers
AgularJS basics- angular directives and controllersAgularJS basics- angular directives and controllers
AgularJS basics- angular directives and controllers
jobinThomas54
 
Single page application 03
Single page application   03Single page application   03
Single page application 03
Ismaeel Enjreny
 
Ng-init
Ng-init Ng-init
Ng-init
Hamdi Hmidi
 
Ng-init
Ng-init Ng-init
Ng-init
Hamdi Hmidi
 
Introduction to-angular js
Introduction to-angular jsIntroduction to-angular js
Introduction to-angular js
Achintya Kumar
 
Angular js
Angular jsAngular js
Angular js
vu van quyet
 
Angular App Presentation
Angular App PresentationAngular App Presentation
Angular App Presentation
Elizabeth Long
 
AngularJS
AngularJSAngularJS

Similar to Introducing angular (20)

AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
 
Angularjs
AngularjsAngularjs
Angularjs
 
Angular js - the beginning
Angular js - the beginningAngular js - the beginning
Angular js - the beginning
 
Angular js for Beginnners
Angular js for BeginnnersAngular js for Beginnners
Angular js for Beginnners
 
AngularJs Basic Concept
AngularJs Basic ConceptAngularJs Basic Concept
AngularJs Basic Concept
 
Controllers in AngularJs
Controllers in AngularJsControllers in AngularJs
Controllers in AngularJs
 
AngularJS Framework
AngularJS FrameworkAngularJS Framework
AngularJS Framework
 
AngularJS Framework
AngularJS FrameworkAngularJS Framework
AngularJS Framework
 
AangularJS Framework
AangularJS FrameworkAangularJS Framework
AangularJS Framework
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
 
Angular js anupama
Angular js anupamaAngular js anupama
Angular js anupama
 
AngularJS
AngularJSAngularJS
AngularJS
 
AgularJS basics- angular directives and controllers
AgularJS basics- angular directives and controllersAgularJS basics- angular directives and controllers
AgularJS basics- angular directives and controllers
 
Single page application 03
Single page application   03Single page application   03
Single page application 03
 
Ng-init
Ng-init Ng-init
Ng-init
 
Ng-init
Ng-init Ng-init
Ng-init
 
Introduction to-angular js
Introduction to-angular jsIntroduction to-angular js
Introduction to-angular js
 
Angular js
Angular jsAngular js
Angular js
 
Angular App Presentation
Angular App PresentationAngular App Presentation
Angular App Presentation
 
AngularJS
AngularJSAngularJS
AngularJS
 

Recently uploaded

ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
YousufSait3
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
kalichargn70th171
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
Marcin Chrost
 
fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.
AnkitaPandya11
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
mz5nrf0n
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 

Recently uploaded (20)

ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
 
fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 

Introducing angular

  • 1.
  • 2. What is Angular? • Client side MVC Framework • Templating Engine • So Much More
  • 3. Client Side MVC • Model is a JavaScript object • View is HTML with AngularJS directives • Controller is a JavaScript class
  • 4. Templating Engine • Part of the Two – Way Data Binding • Implemented Through Directives • UI is Updated as the Model Changes • Model is Updated as the UI Changes
  • 5. A Very Simple Example • Install AngularJS • Install-Package angularjs • Add Script reference at the bottom • <script src="~/Scripts/angular.js"></script> • Calculate LTV for a Mortgage
  • 6. Revisit the jQuery Fast Food Site • New Controller called AngularController • Three Samples • Calculate LTV • Calculate a Payment • Apply
  • 7. AngularController Simply Returns an Empty View public ActionResult MortgageCalculator() { return View(); }
  • 8. Setting Up the View <div ng-app ng-init="loanAmount=150000;appraisedValue=180000"> Tell Angular to start and initialize some data. ng-init rarely used except in simple scenarios.
  • 9. Basic Binding and Simple Expressions ng-model="loanAmount“ ng-model="appraisedValue“ {{(loanAmount/appraisedValue)*100| number:3}}
  • 10. Adding a Controller <div ng-app="mortgageCalculator"> <div ng-controller="calculatorController"> var myApp = angular.module('mortgageCalculator', []); myApp.controller("calculatorController", [
  • 11. Initializing Scope "$scope", function($scope) { $scope.title = "calculatorController"; $scope.amount = 100000; $scope.term = 30; $scope.rate = 4.5;
  • 12. Declaring a Function $scope.calculatePayment = function () { var effectiveRate = ($scope.rate / 100) / 12; var numberOfMonths = $scope.term * 12; var numerator = effectiveRate * Math.pow(effectiveRate + 1, numberOfMonths); var denominator = Math.pow(1 + effectiveRate, numberOfMonths) - 1; $scope.payment = $scope.amount * (numerator / denominator); };
  • 13. Calling the Function <div class="col-md-10"> <button ng-click="calculatePayment()" class="btn btn-default"> Calculate Payment <span class=" glyphicon glyphicon-cog "> </span> </button> </div>
  • 14. Declaring a Function (part 2) <input type="number" min="0" ng-model="amount" ng- change="calculatePayment()" class="form-control text-box single-line">
  • 15. Angular and Razor @Html.LabelFor(model => model.Borrower, htmlAttributes: new { @class = "control-label col-md-2"}) <div class="col-md-10"> @Html.TextBoxFor(model => model.Borrower, htmlAttributes: new { @class = "form-control ", ng_model = "Names.Borrower" }) </div>
  • 16. Angular and Razor <div id="borrowerPanel" class="panel-collapse collapse in"> <div class="panel-body"> @Html.Partial("NamesEditor") </div> </div>
  • 17. Angular and Razor • Attributes