Beginning AngularJS

(WallPaper) #1

coding defensive, 100
controller code, 99
firstName, 96
HTML code, 98
model properties, 97
ngModel, 97
one-way binding, 98
text input, 99
two-way binding, 98
select element, 95
textarea element, 94
$http.post() method, 32
$http service, 122


„„„„„„„„„J, K

JavaScript Object Notation (JSON), 32
JavaScript primer
built-in functions, 14–15
console.log() approach, 3
equality operator, 13
external script, 1
functions, 4
identity operator, 13
inline script, 2
multiple variables, 7–8
operators, 11
parameters and return values, 5
pre-vs. post-increment, 15
primitive types
Boolean value, 8
number type, 10
strings, 9
undefined and null, 11
semicolons, 3
single-line and multiline comments, 4
statement execution, 2
Unexpected identifier error message, 3–4


„„„„„„„„„L

$location service, 117


„„„„„„„„„M

memberDataStoreService, 123
Model View Controller (MVC)
advantages, 52
Array.length property, 55
collaboration, 50
decoupling, 52
design pattern documentation, 47
domain model, 53


DOM manipulation, 55
employees variable, 53
JavaScript implementation, 49
lines of communication, 52
logger object, 50
MyFirstCtrl function, 53
ourEmployees property, 54
refinement, 50
Singleton pattern documentation, 48–49
TDD, 52
testing, 50
UML, 50
view model, 53
myAppModule.js file, 69
MyFilterDemoCtrl, 58
MyFirstCtrl function, 53
myInfo method, 20
mySimpleFunction, 5

„„„„„„„„„N

new Object() technique, 18
Number filter, 61–62

„„„„„„„„„O

Objects
adding methods, 20
arrays
$http.post() method, 32
AngularJS supports, 30
anonymous functions, 29
call operator, 29
communicateWithServer function, 31
enumerating array values, 27
JSON, 32
length property, 26–27
literals, 27
array value modification, 28
myFunctionReference variable, 29–30
numeric index, 25
control flow
conditional statements, 24
for loop, 22
while loop, 23
creation, 17
for in loop, 21
properties, 18
Organizing views
ngRoute module, 131–132
URL routes
About Page, 136
Bootstrap, 135

■ index
Free download pdf