AngularJS Cheatsheet [1/2]
BUILT-IN DIRECTIVES
SCOPE EXTENSION
DIRECTIVE OPTIONS
ng-app=”moduleName”
.controller()
Defines a new controller
scope:
Add rootScope
.directive()
Defines a new directive
falsy
Use parent scope (default)
ng-controller=”controllerName”
.factory()
Defines a new factory
true
Create child scope
Add scope
.filter()
Defines a new filter
{...}
Create isolated scope
ng-hide|show=”bool”
.service()
Defines a new service
@
Bind DOM attribute
Hide or show an element
.provider()
Defines a new provider
=
Required bind from parent
ng-model=”obj”
.value()
Defines a new value
scope
Bind view to a model
.const()
Defines a new const value
=?
Optional parent binding
ng-repeat=”obj”
=*
Shallow parent binding
Repeat an array
GLOBAL FUNCTIONS
ng-view
restrict:
(default: A, E)
Print a template
angular.bind(self, fn, args)
A
Use attribute name
ng-bind
(
<div directive>
)
Bind function to (other) context
Bind variable to a HTML tag as content
angular.bootstrap(element, [modules])
E
Use element name
ng-cloak
Bootstrap the Angular application manually
(
<directive>
)
Prevent template from being displayed until
angular.copy(source, [destination])
C
Use class name
the application has loaded
Create a deep copy of source
(
<div class=”directive”>
)
angular.element(element)
controller
Controller class
ng-FILTERS
Wrap a raw DOM element or HTML string in a
replace
Replace HTML element
jQuery element
currency
transclude
Format number as a currency
Extract the contents of
angular.equals(obj1, obj2)
the element where the
date
Format as a date with a requested format
Check if two objects are equal
directive appears and
filter
Select a subset from an array
angular.fromJson(json)
make it available to
json
Convert JavaScript objects to a JSON
Deserialize a JSON string
the directive.
string
link
angular.isArray(value)
Register DOM listeners
limitTo
Check if reference is an Array
Get a specified number of elements
template
Template HTML as a
angular.isDate(value)
string
lowercase
Convert a string to lowercase
Check if reference is a Date
templateUrl
Load template from
uppercase
Convert a string to uppercase
angular.isDefined(value)
specified URL
number
Format output as a number
Check if reference is defined
templateNamespace
angular.isNumber(value)
orderBy
Order output by expression
String representing the
Check if reference is a Number
document type used by
angular.toJson(obj, [pretty])
the markup in the template.
Serialize input into a JSON string
(HTML, SVG, Math).
angular.version
Provide information about AngularJS version
AngularJS Cheatsheet
version 1.0.0
Need an AngularJS app developed? Hire us!
avarteq.de