T/F: AngularJS expressions are much like JavaScript expressions: They can contain literals, operators, and variables.
A) True
B) False
A) True
AngularJS expressions are much like JavaScript expressions: They can contain literals, operators, and variables.
Example {{ 5 + 5 }} or {{ firstName + " " + lastName }}
T/F: Like JavaScript expressions, AngularJS expressions cannot be written inside HTML.
A) True
B) False
B) False
Unlike JavaScript expressions, AngularJS expressions can be written inside HTML.
T/F: AngularJS expressions do not support conditionals, loops, and exceptions, while JavaScript expressions do.
A) True
B) False
A) True
AngularJS expressions do not support conditionals, loops, and exceptions, while JavaScript expressions do.
T/F: Like JavaScript expressions, AngularJS expressions cannot contain literals, operators, and variables.
A) True
B) False
B) False
Like JavaScript expressions, AngularJS expressions CAN contain literals, operators, and variables.
T/F: AngularJS expressions support filters, while JavaScript expressions do not.
A) True
B) False
A) True
AngularJS expressions support filters, while JavaScript expressions do not.
Review Point
AngularJS Modules
An AngularJS module defines an application.
The module is a container for the different parts of an application.
The module is a container for the application controllers.
Controllers always belong to a module.
A module is created by using the AngularJS function _________________.
angular.module
Example:
<div ng-app="myApp">...</div>
<script>
var app = angular.module("myApp", []);
</script>
What is an Angular directive and what is it used for?
AngularJS directives are extended HTML attributes with the prefix ng- . The ng-app directive initializes an AngularJS application. The ng-init directive initializes application data. The ng-model directive binds the value of HTML controls (input, select, textarea) to application data.