users/mariusz/dropbox/dokumenty/workspace/in … · 2016-01-27 · scopeextension.controller()...
Post on 09-Jul-2020
3 Views
Preview:
TRANSCRIPT
SCOPE EXTENSION
.controller() Defines a new controller
.directive() Defines a new directive
.factory() Defines a new factory
.filter() Defines a new filter
.service() Defines a new service
.provider() Defines a new provider
.value() Defines a new value
.const() Defines a new const value
DIRECTIVEOPTIONS
scope:falsy Use parent scope (default)true Create child scope{...} Create isolated scope
@ Bind DOMattribute= Required bind from parent
scope
=? Optional parent binding
=* Shallow parent binding
restrict: (default: A, E)
A Use attribute name(<div directive>)
E Use element name(<directive>)
C Use class name(<div class=”directive”>)
controller Controller class
replace Replace HTML elementtransclude Extract the contents of
the element where thedirective appears andmake it available tothe directive.
link Register DOM listeners
template Template HTML as astring
templateUrl Load template fromspecified URL
templateNamespaceString representing thedocument type used bythemarkup in the template.(HTML, SVG,Math).
BUILT-INDIRECTIVES
ng-app=”moduleName”Add rootScope
ng-controller=”controllerName”Add scope
ng-hide|show=”bool”Hide or show an element
ng-model=”obj”Bind view to amodel
ng-repeat=”obj”Repeat an array
ng-viewPrint a template
ng-bindBind variable to a HTML tag as content
ng-cloakPrevent template from being displayed untilthe application has loaded
ng-FILTERS
currency Format number as a currency
date Format as a date with a requested format
filter Select a subset from an array
json Convert JavaScript objects to a JSONstring
limitTo Get a specified number of elements
lowercase Convert a string to lowercase
uppercase Convert a string to uppercase
number Format output as a number
orderBy Order output by expression
AngularJSCheatsheet version 1.0.0 Need an AngularJS app developed? Hire us! avarteq.de
AngularJS Cheatsheet [1/2]
GLOBAL FUNCTIONS
angular.bind(self, fn, args)
angular.bootstrap(element, [modules])Bootstrap the Angular applicationmanually
angular.copy(source, [destination])Create a deep copy of source
angular.element(element)Wrap a rawDOMelement or HTML string in ajQuery element
angular.equals(obj1, obj2)Check if two objects are equal
angular.fromJson(json)Deserialize a JSON string
Bind function to (other) context
angular.isArray(value)Check if reference is an Array
angular.isDate(value)Check if reference is a Date
angular.isDefined(value)Check if reference is defined
angular.isNumber(value)Check if reference is a Number
angular.toJson(obj, [pretty])Serialize input into a JSON string
angular.versionProvide information about AngularJS version
SERVICES
$anchorScroll
$animate.on(event, container, callback)DOManimation
$animateCssTrigger CSS-based animation
$cacheFactoryConstruct Cache objects
$controllerInstantiate a controller
$documentAngular wrapper for window.document
$exceptionHandlerHandle UncaughtException
$filterFormat data
$httpMakeHTTP requests
$httpBackendDelegates to XMLHttpRequest object or JSONP
$httpParamSerializer
$httpParamSerializerJQLike
$interpolate
Converts objects to strings
Alternative $http param serializer
Compiles a string withmarkup into an interpolationfunction
$intervalExecute a function every interval
$localeProvides localization rules
$anchorScrollProviderDisable automated scrolling
$animateProviderSynchronously performsDOManimation
$compileProviderSynchronously performsDOManimation
$controllerProviderRegister a new controller
$filterProviderRegister a new filter
$httpProviderChange the default behavior of the $http service
$interpolateProviderConfigure the interpolationmarkup
$locationProviderConfigure how your application is handling the deeplinking paths
$logProviderConfigure how the application logsmessages
$parseProviderUsed for configuring the default behavior of the$parse service
$rootScopeProviderConfiguration for the $rootScope service
$sceDelegateProviderConfiguration for the $rootScope service
$sceProviderConfiguration for the $sce service
PROVIDERS
$locationProvides interface to URLmanipulation
$logService for logging
$parseConverts Angular expression into a function
$qRun functions asynchronously
$rootElementRoot element for Angular application
$rootScopeGlobal variable store
$sceProvides strict contextual escaping
$sceDelegateUsed by $sce
$templateCacheCaches template files
$templateRequestRuns security checks and downloads template
$timeoutAngular wrapper for window.setTimeout
$windowReference to browser window object
$xhrFactoryCreate XMLHttpRequest objects
AngularJSCheatsheet version 1.0.0 Need an AngularJS app developed? Hire us! avarteq.de
AngularJS Cheatsheet [2/2]
top related