code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
function $xhrFactoryProvider() {
this.$get = function() {
return function createXhr() {
return new window.XMLHttpRequest();
};
};
} | @ngdoc service
@name $xhrFactory
@this
@description
Factory function used to create XMLHttpRequest objects.
Replace or decorate this service to create your own custom XMLHttpRequest objects.
```
angular.module('myApp', [])
.factory('$xhrFactory', function() {
return function createXhr(method, url) {
return new... | $xhrFactoryProvider | javascript | angular/angular.js | src/ng/httpBackend.js | https://github.com/angular/angular.js/blob/master/src/ng/httpBackend.js | MIT |
function $HttpBackendProvider() {
this.$get = ['$browser', '$jsonpCallbacks', '$document', '$xhrFactory', function($browser, $jsonpCallbacks, $document, $xhrFactory) {
return createHttpBackend($browser, $xhrFactory, $browser.defer, $jsonpCallbacks, $document[0]);
}];
} | @ngdoc service
@name $httpBackend
@requires $jsonpCallbacks
@requires $document
@requires $xhrFactory
@this
@description
HTTP backend used by the {@link ng.$http service} that delegates to
XMLHttpRequest object or JSONP and deals with browser incompatibilities.
You should never need to use this service directly, inst... | $HttpBackendProvider | javascript | angular/angular.js | src/ng/httpBackend.js | https://github.com/angular/angular.js/blob/master/src/ng/httpBackend.js | MIT |
function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) {
// TODO(vojta): fix the signature
return function(method, url, post, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers) {
url = url || $browser.url();
if (lowercase(method) =... | @ngdoc service
@name $httpBackend
@requires $jsonpCallbacks
@requires $document
@requires $xhrFactory
@this
@description
HTTP backend used by the {@link ng.$http service} that delegates to
XMLHttpRequest object or JSONP and deals with browser incompatibilities.
You should never need to use this service directly, inst... | createHttpBackend | javascript | angular/angular.js | src/ng/httpBackend.js | https://github.com/angular/angular.js/blob/master/src/ng/httpBackend.js | MIT |
requestError = function() {
// The response is always empty
// See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error
completeRequest(callback, -1, null, null, '', 'error');
} | @ngdoc service
@name $httpBackend
@requires $jsonpCallbacks
@requires $document
@requires $xhrFactory
@this
@description
HTTP backend used by the {@link ng.$http service} that delegates to
XMLHttpRequest object or JSONP and deals with browser incompatibilities.
You should never need to use this service directly, inst... | requestError | javascript | angular/angular.js | src/ng/httpBackend.js | https://github.com/angular/angular.js/blob/master/src/ng/httpBackend.js | MIT |
requestAborted = function() {
completeRequest(callback, -1, null, null, '', abortedByTimeout ? 'timeout' : 'abort');
} | @ngdoc service
@name $httpBackend
@requires $jsonpCallbacks
@requires $document
@requires $xhrFactory
@this
@description
HTTP backend used by the {@link ng.$http service} that delegates to
XMLHttpRequest object or JSONP and deals with browser incompatibilities.
You should never need to use this service directly, inst... | requestAborted | javascript | angular/angular.js | src/ng/httpBackend.js | https://github.com/angular/angular.js/blob/master/src/ng/httpBackend.js | MIT |
requestTimeout = function() {
// The response is always empty
// See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error
completeRequest(callback, -1, null, null, '', 'timeout');
} | @ngdoc service
@name $httpBackend
@requires $jsonpCallbacks
@requires $document
@requires $xhrFactory
@this
@description
HTTP backend used by the {@link ng.$http service} that delegates to
XMLHttpRequest object or JSONP and deals with browser incompatibilities.
You should never need to use this service directly, inst... | requestTimeout | javascript | angular/angular.js | src/ng/httpBackend.js | https://github.com/angular/angular.js/blob/master/src/ng/httpBackend.js | MIT |
function timeoutRequest(reason) {
abortedByTimeout = reason === 'timeout';
if (jsonpDone) {
jsonpDone();
}
if (xhr) {
xhr.abort();
}
} | @ngdoc service
@name $httpBackend
@requires $jsonpCallbacks
@requires $document
@requires $xhrFactory
@this
@description
HTTP backend used by the {@link ng.$http service} that delegates to
XMLHttpRequest object or JSONP and deals with browser incompatibilities.
You should never need to use this service directly, inst... | timeoutRequest | javascript | angular/angular.js | src/ng/httpBackend.js | https://github.com/angular/angular.js/blob/master/src/ng/httpBackend.js | MIT |
function completeRequest(callback, status, response, headersString, statusText, xhrStatus) {
// cancel timeout and subsequent timeout promise resolution
if (isDefined(timeoutId)) {
$browserDefer.cancel(timeoutId);
}
jsonpDone = xhr = null;
callback(status, response, headersString,... | @ngdoc service
@name $httpBackend
@requires $jsonpCallbacks
@requires $document
@requires $xhrFactory
@this
@description
HTTP backend used by the {@link ng.$http service} that delegates to
XMLHttpRequest object or JSONP and deals with browser incompatibilities.
You should never need to use this service directly, inst... | completeRequest | javascript | angular/angular.js | src/ng/httpBackend.js | https://github.com/angular/angular.js/blob/master/src/ng/httpBackend.js | MIT |
function jsonpReq(url, callbackPath, done) {
url = url.replace('JSON_CALLBACK', callbackPath);
// we can't use jQuery/jqLite here because jQuery does crazy stuff with script elements, e.g.:
// - fetches local scripts via XHR and evals them
// - adds and immediately removes script elements from the docum... | @ngdoc service
@name $httpBackend
@requires $jsonpCallbacks
@requires $document
@requires $xhrFactory
@this
@description
HTTP backend used by the {@link ng.$http service} that delegates to
XMLHttpRequest object or JSONP and deals with browser incompatibilities.
You should never need to use this service directly, inst... | jsonpReq | javascript | angular/angular.js | src/ng/httpBackend.js | https://github.com/angular/angular.js/blob/master/src/ng/httpBackend.js | MIT |
function $InterpolateProvider() {
var startSymbol = '{{';
var endSymbol = '}}';
/**
* @ngdoc method
* @name $interpolateProvider#startSymbol
* @description
* Symbol to denote start of expression in the interpolated string. Defaults to `{{`.
*
* @param {string=} value new value to set the starti... | @ngdoc provider
@name $interpolateProvider
@this
@description
Used for configuring the interpolation markup. Defaults to `{{` and `}}`.
<div class="alert alert-danger">
This feature is sometimes used to mix different markup languages, e.g. to wrap an AngularJS
template within a Python Jinja template (or any other te... | $InterpolateProvider | javascript | angular/angular.js | src/ng/interpolate.js | https://github.com/angular/angular.js/blob/master/src/ng/interpolate.js | MIT |
function escape(ch) {
return '\\\\\\' + ch;
} | @ngdoc method
@name $interpolateProvider#endSymbol
@description
Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.
@param {string=} value new value to set the ending symbol to.
@returns {string|self} Returns the symbol when used as getter and self if used as setter. | escape | javascript | angular/angular.js | src/ng/interpolate.js | https://github.com/angular/angular.js/blob/master/src/ng/interpolate.js | MIT |
function unescapeText(text) {
return text.replace(escapedStartRegexp, startSymbol).
replace(escapedEndRegexp, endSymbol);
} | @ngdoc method
@name $interpolateProvider#endSymbol
@description
Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.
@param {string=} value new value to set the ending symbol to.
@returns {string|self} Returns the symbol when used as getter and self if used as setter. | unescapeText | javascript | angular/angular.js | src/ng/interpolate.js | https://github.com/angular/angular.js/blob/master/src/ng/interpolate.js | MIT |
function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {
var unwatch = scope.$watch(function constantInterpolateWatch(scope) {
unwatch();
return constantInterp(scope);
}, listener, objectEquality);
return unwatch;
} | @ngdoc method
@name $interpolateProvider#endSymbol
@description
Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.
@param {string=} value new value to set the ending symbol to.
@returns {string|self} Returns the symbol when used as getter and self if used as setter. | constantWatchDelegate | javascript | angular/angular.js | src/ng/interpolate.js | https://github.com/angular/angular.js/blob/master/src/ng/interpolate.js | MIT |
function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) {
var contextAllowsConcatenation = trustedContext === $sce.URL || trustedContext === $sce.MEDIA_URL;
// Provide a quick exit and simplified result function for text with no interpolation
if (!text.length || text.indexOf(sta... | @ngdoc service
@name $interpolate
@kind function
@requires $parse
@requires $sce
@description
Compiles a string with markup into an interpolation function. This service is used by the
HTML {@link ng.$compile $compile} service for data binding. See
{@link ng.$interpolateProvider $interpolateProvider} for configuring ... | $interpolate | javascript | angular/angular.js | src/ng/interpolate.js | https://github.com/angular/angular.js/blob/master/src/ng/interpolate.js | MIT |
compute = function(values) {
for (var i = 0, ii = expressions.length; i < ii; i++) {
if (allOrNothing && isUndefined(values[i])) return;
concat[expressionPositions[i]] = values[i];
}
if (contextAllowsConcatenation) {
// If `singleExpression` then `conca... | @ngdoc service
@name $interpolate
@kind function
@requires $parse
@requires $sce
@description
Compiles a string with markup into an interpolation function. This service is used by the
HTML {@link ng.$compile $compile} service for data binding. See
{@link ng.$interpolateProvider $interpolateProvider} for configuring ... | compute | javascript | angular/angular.js | src/ng/interpolate.js | https://github.com/angular/angular.js/blob/master/src/ng/interpolate.js | MIT |
$jsonpCallbacksProvider = /** @this */ function() {
this.$get = function() {
var callbacks = angular.callbacks;
var callbackMap = {};
function createCallback(callbackId) {
var callback = function(data) {
callback.data = data;
callback.called = true;
};
callback.id = call... | @ngdoc service
@name $jsonpCallbacks
@requires $window
@description
This service handles the lifecycle of callbacks to handle JSONP requests.
Override this service if you wish to customise where the callbacks are stored and
how they vary compared to the requested url. | $jsonpCallbacksProvider | javascript | angular/angular.js | src/ng/jsonpCallbacks.js | https://github.com/angular/angular.js/blob/master/src/ng/jsonpCallbacks.js | MIT |
function encodePath(path) {
var segments = path.split('/'),
i = segments.length;
while (i--) {
// decode forward slashes to prevent them from being double encoded
segments[i] = encodeUriSegment(segments[i].replace(/%2F/g, '/'));
}
return segments.join('/');
} | Encode path using encodeUriSegment, ignoring forward slashes
@param {string} path Path to encode
@returns {string} | encodePath | javascript | angular/angular.js | src/ng/location.js | https://github.com/angular/angular.js/blob/master/src/ng/location.js | MIT |
function decodePath(path, html5Mode) {
var segments = path.split('/'),
i = segments.length;
while (i--) {
segments[i] = decodeURIComponent(segments[i]);
if (html5Mode) {
// encode forward slashes to prevent them from being mistaken for path separators
segments[i] = segments[i].replace(/\/... | Encode path using encodeUriSegment, ignoring forward slashes
@param {string} path Path to encode
@returns {string} | decodePath | javascript | angular/angular.js | src/ng/location.js | https://github.com/angular/angular.js/blob/master/src/ng/location.js | MIT |
function normalizePath(pathValue, searchValue, hashValue) {
var search = toKeyValue(searchValue),
hash = hashValue ? '#' + encodeUriSegment(hashValue) : '',
path = encodePath(pathValue);
return path + (search ? '?' + search : '') + hash;
} | Encode path using encodeUriSegment, ignoring forward slashes
@param {string} path Path to encode
@returns {string} | normalizePath | javascript | angular/angular.js | src/ng/location.js | https://github.com/angular/angular.js/blob/master/src/ng/location.js | MIT |
function parseAbsoluteUrl(absoluteUrl, locationObj) {
var parsedUrl = urlResolve(absoluteUrl);
locationObj.$$protocol = parsedUrl.protocol;
locationObj.$$host = parsedUrl.hostname;
locationObj.$$port = toInt(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null;
} | Encode path using encodeUriSegment, ignoring forward slashes
@param {string} path Path to encode
@returns {string} | parseAbsoluteUrl | javascript | angular/angular.js | src/ng/location.js | https://github.com/angular/angular.js/blob/master/src/ng/location.js | MIT |
function parseAppUrl(url, locationObj, html5Mode) {
if (DOUBLE_SLASH_REGEX.test(url)) {
throw $locationMinErr('badpath', 'Invalid url "{0}".', url);
}
var prefixed = (url.charAt(0) !== '/');
if (prefixed) {
url = '/' + url;
}
var match = urlResolve(url);
var path = prefixed && match.pathname.cha... | Encode path using encodeUriSegment, ignoring forward slashes
@param {string} path Path to encode
@returns {string} | parseAppUrl | javascript | angular/angular.js | src/ng/location.js | https://github.com/angular/angular.js/blob/master/src/ng/location.js | MIT |
function startsWith(str, search) {
return str.slice(0, search.length) === search;
} | Encode path using encodeUriSegment, ignoring forward slashes
@param {string} path Path to encode
@returns {string} | startsWith | javascript | angular/angular.js | src/ng/location.js | https://github.com/angular/angular.js/blob/master/src/ng/location.js | MIT |
function stripBaseUrl(base, url) {
if (startsWith(url, base)) {
return url.substr(base.length);
}
} | @param {string} base
@param {string} url
@returns {string} returns text from `url` after `base` or `undefined` if it does not begin with
the expected string. | stripBaseUrl | javascript | angular/angular.js | src/ng/location.js | https://github.com/angular/angular.js/blob/master/src/ng/location.js | MIT |
function stripHash(url) {
var index = url.indexOf('#');
return index === -1 ? url : url.substr(0, index);
} | @param {string} base
@param {string} url
@returns {string} returns text from `url` after `base` or `undefined` if it does not begin with
the expected string. | stripHash | javascript | angular/angular.js | src/ng/location.js | https://github.com/angular/angular.js/blob/master/src/ng/location.js | MIT |
function stripFile(url) {
return url.substr(0, stripHash(url).lastIndexOf('/') + 1);
} | @param {string} base
@param {string} url
@returns {string} returns text from `url` after `base` or `undefined` if it does not begin with
the expected string. | stripFile | javascript | angular/angular.js | src/ng/location.js | https://github.com/angular/angular.js/blob/master/src/ng/location.js | MIT |
function serverBase(url) {
return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));
} | @param {string} base
@param {string} url
@returns {string} returns text from `url` after `base` or `undefined` if it does not begin with
the expected string. | serverBase | javascript | angular/angular.js | src/ng/location.js | https://github.com/angular/angular.js/blob/master/src/ng/location.js | MIT |
function LocationHtml5Url(appBase, appBaseNoFile, basePrefix) {
this.$$html5 = true;
basePrefix = basePrefix || '';
parseAbsoluteUrl(appBase, this);
/**
* Parse given HTML5 (regular) URL string into properties
* @param {string} url HTML5 URL
* @private
*/
this.$$parse = function(url) {
var p... | LocationHtml5Url represents a URL
This object is exposed as $location service when HTML5 mode is enabled and supported
@constructor
@param {string} appBase application base URL
@param {string} appBaseNoFile application base URL stripped of any filename
@param {string} basePrefix URL path prefix | LocationHtml5Url | javascript | angular/angular.js | src/ng/location.js | https://github.com/angular/angular.js/blob/master/src/ng/location.js | MIT |
function LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) {
parseAbsoluteUrl(appBase, this);
/**
* Parse given hashbang URL into properties
* @param {string} url Hashbang URL
* @private
*/
this.$$parse = function(url) {
var withoutBaseUrl = stripBaseUrl(appBase, url) || stripBaseUrl(appB... | LocationHashbangUrl represents URL
This object is exposed as $location service when developer doesn't opt into html5 mode.
It also serves as the base class for html5 mode fallback on legacy browsers.
@constructor
@param {string} appBase application base URL
@param {string} appBaseNoFile application base URL stripped o... | LocationHashbangUrl | javascript | angular/angular.js | src/ng/location.js | https://github.com/angular/angular.js/blob/master/src/ng/location.js | MIT |
function LocationHashbangInHtml5Url(appBase, appBaseNoFile, hashPrefix) {
this.$$html5 = true;
LocationHashbangUrl.apply(this, arguments);
this.$$parseLinkUrl = function(url, relHref) {
if (relHref && relHref[0] === '#') {
// special case for links to hash fragments:
// keep the old url and only ... | LocationHashbangUrl represents URL
This object is exposed as $location service when html5 history api is enabled but the browser
does not support it.
@constructor
@param {string} appBase application base URL
@param {string} appBaseNoFile application base URL stripped of any filename
@param {string} hashPrefix hashbang... | LocationHashbangInHtml5Url | javascript | angular/angular.js | src/ng/location.js | https://github.com/angular/angular.js/blob/master/src/ng/location.js | MIT |
function locationGetter(property) {
return /** @this */ function() {
return this[property];
};
} | @ngdoc method
@name $location#state
@description
This method is getter / setter.
Return the history state object when called without any parameter.
Change the history state object when called with one parameter and return `$location`.
The state object is later passed to `pushState` or `replaceState`.
NOTE: This met... | locationGetter | javascript | angular/angular.js | src/ng/location.js | https://github.com/angular/angular.js/blob/master/src/ng/location.js | MIT |
function urlsEqual(a, b) {
return a === b || urlResolve(a).href === urlResolve(b).href;
} | @ngdoc event
@name $location#$locationChangeSuccess
@eventType broadcast on root scope
@description
Broadcasted after a URL was changed.
The `newState` and `oldState` parameters may be defined only in HTML5 mode and when
the browser supports the HTML5 History API.
@param {Object} angularEvent Synthetic event object.
... | urlsEqual | javascript | angular/angular.js | src/ng/location.js | https://github.com/angular/angular.js/blob/master/src/ng/location.js | MIT |
function setBrowserUrlWithFallback(url, replace, state) {
var oldUrl = $location.url();
var oldState = $location.$$state;
try {
$browser.url(url, replace, state);
// Make sure $location.state() returns referentially identical (not just deeply equal)
// state object; this makes... | @ngdoc event
@name $location#$locationChangeSuccess
@eventType broadcast on root scope
@description
Broadcasted after a URL was changed.
The `newState` and `oldState` parameters may be defined only in HTML5 mode and when
the browser supports the HTML5 History API.
@param {Object} angularEvent Synthetic event object.
... | setBrowserUrlWithFallback | javascript | angular/angular.js | src/ng/location.js | https://github.com/angular/angular.js/blob/master/src/ng/location.js | MIT |
function afterLocationChange(oldUrl, oldState) {
$rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl,
$location.$$state, oldState);
} | @ngdoc event
@name $location#$locationChangeSuccess
@eventType broadcast on root scope
@description
Broadcasted after a URL was changed.
The `newState` and `oldState` parameters may be defined only in HTML5 mode and when
the browser supports the HTML5 History API.
@param {Object} angularEvent Synthetic event object.
... | afterLocationChange | javascript | angular/angular.js | src/ng/location.js | https://github.com/angular/angular.js/blob/master/src/ng/location.js | MIT |
function $LogProvider() {
var debug = true,
self = this;
/**
* @ngdoc method
* @name $logProvider#debugEnabled
* @description
* @param {boolean=} flag enable or disable debug level messages
* @returns {*} current value if used as getter or itself (chaining) if used as setter
*/
this.debug... | @ngdoc provider
@name $logProvider
@this
@description
Use the `$logProvider` to configure how the application logs messages | $LogProvider | javascript | angular/angular.js | src/ng/log.js | https://github.com/angular/angular.js/blob/master/src/ng/log.js | MIT |
function formatError(arg) {
if (isError(arg)) {
if (arg.stack && formatStackTrace) {
arg = (arg.message && arg.stack.indexOf(arg.message) === -1)
? 'Error: ' + arg.message + '\n' + arg.stack
: arg.stack;
} else if (arg.sourceURL) {
arg = arg.message ... | @ngdoc method
@name $log#debug
@description
Write a debug message | formatError | javascript | angular/angular.js | src/ng/log.js | https://github.com/angular/angular.js/blob/master/src/ng/log.js | MIT |
function consoleLog(type) {
var console = $window.console || {},
logFn = console[type] || console.log || noop;
return function() {
var args = [];
forEach(arguments, function(arg) {
args.push(formatError(arg));
});
// Support: IE 9 only
// console ... | @ngdoc method
@name $log#debug
@description
Write a debug message | consoleLog | javascript | angular/angular.js | src/ng/log.js | https://github.com/angular/angular.js/blob/master/src/ng/log.js | MIT |
function $ParseProvider() {
var cache = createMap();
var literals = {
'true': true,
'false': false,
'null': null,
'undefined': undefined
};
var identStart, identContinue;
/**
* @ngdoc method
* @name $parseProvider#addLiteral
* @description
*
* Configure $parse service to add li... | @ngdoc provider
@name $parseProvider
@this
@description
`$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse}
service. | $ParseProvider | javascript | angular/angular.js | src/ng/parse.js | https://github.com/angular/angular.js/blob/master/src/ng/parse.js | MIT |
function $parse(exp, interceptorFn) {
var parsedExpression, cacheKey;
switch (typeof exp) {
case 'string':
exp = exp.trim();
cacheKey = exp;
parsedExpression = cache[cacheKey];
if (!parsedExpression) {
var lexer = new Lexer($parseOptions);
... | @ngdoc method
@name $parseProvider#setIdentifierFns
@description
Allows defining the set of characters that are allowed in AngularJS expressions. The function
`identifierStart` will get called to know if a given character is a valid character to be the
first character for an identifier. The function `identifierContin... | $parse | javascript | angular/angular.js | src/ng/parse.js | https://github.com/angular/angular.js/blob/master/src/ng/parse.js | MIT |
function $$getAst(exp) {
var lexer = new Lexer($parseOptions);
var parser = new Parser(lexer, $filter, $parseOptions);
return parser.getAst(exp).ast;
} | @ngdoc method
@name $parseProvider#setIdentifierFns
@description
Allows defining the set of characters that are allowed in AngularJS expressions. The function
`identifierStart` will get called to know if a given character is a valid character to be the
first character for an identifier. The function `identifierContin... | $$getAst | javascript | angular/angular.js | src/ng/parse.js | https://github.com/angular/angular.js/blob/master/src/ng/parse.js | MIT |
function expressionInputDirtyCheck(newValue, oldValueOfValue, compareObjectIdentity) {
if (newValue == null || oldValueOfValue == null) { // null/undefined
return newValue === oldValueOfValue;
}
if (typeof newValue === 'object') {
// attempt to convert the value to a primitive type
... | @ngdoc method
@name $parseProvider#setIdentifierFns
@description
Allows defining the set of characters that are allowed in AngularJS expressions. The function
`identifierStart` will get called to know if a given character is a valid character to be the
first character for an identifier. The function `identifierContin... | expressionInputDirtyCheck | javascript | angular/angular.js | src/ng/parse.js | https://github.com/angular/angular.js/blob/master/src/ng/parse.js | MIT |
function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) {
var inputExpressions = parsedExpression.inputs;
var lastResult;
if (inputExpressions.length === 1) {
var oldInputValueOf = expressionInputDirtyCheck; // init to something unique so that eq... | @ngdoc method
@name $parseProvider#setIdentifierFns
@description
Allows defining the set of characters that are allowed in AngularJS expressions. The function
`identifierStart` will get called to know if a given character is a valid character to be the
first character for an identifier. The function `identifierContin... | inputsWatchDelegate | javascript | angular/angular.js | src/ng/parse.js | https://github.com/angular/angular.js/blob/master/src/ng/parse.js | MIT |
function oneTimeWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) {
var isDone = parsedExpression.literal ? isAllDefined : isDefined;
var unwatch, lastValue;
var exp = parsedExpression.$$intercepted || parsedExpression;
var post = parsedExpression.$$interce... | @ngdoc method
@name $parseProvider#setIdentifierFns
@description
Allows defining the set of characters that are allowed in AngularJS expressions. The function
`identifierStart` will get called to know if a given character is a valid character to be the
first character for an identifier. The function `identifierContin... | oneTimeWatchDelegate | javascript | angular/angular.js | src/ng/parse.js | https://github.com/angular/angular.js/blob/master/src/ng/parse.js | MIT |
function unwatchIfDone() {
if (isDone(lastValue)) {
unwatch();
}
} | @ngdoc method
@name $parseProvider#setIdentifierFns
@description
Allows defining the set of characters that are allowed in AngularJS expressions. The function
`identifierStart` will get called to know if a given character is a valid character to be the
first character for an identifier. The function `identifierContin... | unwatchIfDone | javascript | angular/angular.js | src/ng/parse.js | https://github.com/angular/angular.js/blob/master/src/ng/parse.js | MIT |
function oneTimeWatch(scope, locals, assign, inputs) {
lastValue = useInputs && inputs ? inputs[0] : exp(scope, locals, assign, inputs);
if (isDone(lastValue)) {
scope.$$postDigest(unwatchIfDone);
}
return post(lastValue);
} | @ngdoc method
@name $parseProvider#setIdentifierFns
@description
Allows defining the set of characters that are allowed in AngularJS expressions. The function
`identifierStart` will get called to know if a given character is a valid character to be the
first character for an identifier. The function `identifierContin... | oneTimeWatch | javascript | angular/angular.js | src/ng/parse.js | https://github.com/angular/angular.js/blob/master/src/ng/parse.js | MIT |
function isAllDefined(value) {
var allDefined = true;
forEach(value, function(val) {
if (!isDefined(val)) allDefined = false;
});
return allDefined;
} | @ngdoc method
@name $parseProvider#setIdentifierFns
@description
Allows defining the set of characters that are allowed in AngularJS expressions. The function
`identifierStart` will get called to know if a given character is a valid character to be the
first character for an identifier. The function `identifierContin... | isAllDefined | javascript | angular/angular.js | src/ng/parse.js | https://github.com/angular/angular.js/blob/master/src/ng/parse.js | MIT |
function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) {
var unwatch = scope.$watch(function constantWatch(scope) {
unwatch();
return parsedExpression(scope);
}, listener, objectEquality);
return unwatch;
} | @ngdoc method
@name $parseProvider#setIdentifierFns
@description
Allows defining the set of characters that are allowed in AngularJS expressions. The function
`identifierStart` will get called to know if a given character is a valid character to be the
first character for an identifier. The function `identifierContin... | constantWatchDelegate | javascript | angular/angular.js | src/ng/parse.js | https://github.com/angular/angular.js/blob/master/src/ng/parse.js | MIT |
function addWatchDelegate(parsedExpression) {
if (parsedExpression.constant) {
parsedExpression.$$watchDelegate = constantWatchDelegate;
} else if (parsedExpression.oneTime) {
parsedExpression.$$watchDelegate = oneTimeWatchDelegate;
} else if (parsedExpression.inputs) {
parsedE... | @ngdoc method
@name $parseProvider#setIdentifierFns
@description
Allows defining the set of characters that are allowed in AngularJS expressions. The function
`identifierStart` will get called to know if a given character is a valid character to be the
first character for an identifier. The function `identifierContin... | addWatchDelegate | javascript | angular/angular.js | src/ng/parse.js | https://github.com/angular/angular.js/blob/master/src/ng/parse.js | MIT |
function chainInterceptors(first, second) {
function chainedInterceptor(value) {
return second(first(value));
}
chainedInterceptor.$stateful = first.$stateful || second.$stateful;
chainedInterceptor.$$pure = first.$$pure && second.$$pure;
return chainedInterceptor;
} | @ngdoc method
@name $parseProvider#setIdentifierFns
@description
Allows defining the set of characters that are allowed in AngularJS expressions. The function
`identifierStart` will get called to know if a given character is a valid character to be the
first character for an identifier. The function `identifierContin... | chainInterceptors | javascript | angular/angular.js | src/ng/parse.js | https://github.com/angular/angular.js/blob/master/src/ng/parse.js | MIT |
function chainedInterceptor(value) {
return second(first(value));
} | @ngdoc method
@name $parseProvider#setIdentifierFns
@description
Allows defining the set of characters that are allowed in AngularJS expressions. The function
`identifierStart` will get called to know if a given character is a valid character to be the
first character for an identifier. The function `identifierContin... | chainedInterceptor | javascript | angular/angular.js | src/ng/parse.js | https://github.com/angular/angular.js/blob/master/src/ng/parse.js | MIT |
function addInterceptor(parsedExpression, interceptorFn) {
if (!interceptorFn) return parsedExpression;
// Extract any existing interceptors out of the parsedExpression
// to ensure the original parsedExpression is always the $$intercepted
if (parsedExpression.$$interceptor) {
intercept... | @ngdoc method
@name $parseProvider#setIdentifierFns
@description
Allows defining the set of characters that are allowed in AngularJS expressions. The function
`identifierStart` will get called to know if a given character is a valid character to be the
first character for an identifier. The function `identifierContin... | addInterceptor | javascript | angular/angular.js | src/ng/parse.js | https://github.com/angular/angular.js/blob/master/src/ng/parse.js | MIT |
fn = function interceptedExpression(scope, locals, assign, inputs) {
var value = useInputs && inputs ? inputs[0] : parsedExpression(scope, locals, assign, inputs);
return interceptorFn(value);
} | @ngdoc method
@name $parseProvider#setIdentifierFns
@description
Allows defining the set of characters that are allowed in AngularJS expressions. The function
`identifierStart` will get called to know if a given character is a valid character to be the
first character for an identifier. The function `identifierContin... | fn | javascript | angular/angular.js | src/ng/parse.js | https://github.com/angular/angular.js/blob/master/src/ng/parse.js | MIT |
function $QProvider() {
var errorOnUnhandledRejections = true;
this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) {
return qFactory(function(callback) {
$rootScope.$evalAsync(callback);
}, $exceptionHandler, errorOnUnhandledRejections);
}];
/**
* @ngdoc met... | @ngdoc provider
@name $qProvider
@this
@description | $QProvider | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function qFactory(nextTick, exceptionHandler, errorOnUnhandledRejections) {
var $qMinErr = minErr('$q', TypeError);
var queueSize = 0;
var checkQueue = [];
/**
* @ngdoc method
* @name ng.$q#defer
* @kind function
*
* @description
* Creates a `Deferred` object which represents a task which wil... | Constructs a promise manager.
@param {function(function)} nextTick Function for executing functions in the next turn.
@param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for
debugging purposes.
@param {boolean=} errorOnUnhandledRejections Whether an error should be generat... | qFactory | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function defer() {
return new Deferred();
} | @ngdoc method
@name ng.$q#defer
@kind function
@description
Creates a `Deferred` object which represents a task which will finish in the future.
@returns {Deferred} Returns a new instance of deferred. | defer | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function Deferred() {
var promise = this.promise = new Promise();
//Non prototype methods necessary to support unbound execution :/
this.resolve = function(val) { resolvePromise(promise, val); };
this.reject = function(reason) { rejectPromise(promise, reason); };
this.notify = function(progress) { n... | @ngdoc method
@name ng.$q#defer
@kind function
@description
Creates a `Deferred` object which represents a task which will finish in the future.
@returns {Deferred} Returns a new instance of deferred. | Deferred | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function Promise() {
this.$$state = { status: 0 };
} | @ngdoc method
@name ng.$q#defer
@kind function
@description
Creates a `Deferred` object which represents a task which will finish in the future.
@returns {Deferred} Returns a new instance of deferred. | Promise | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function processQueue(state) {
var fn, promise, pending;
pending = state.pending;
state.processScheduled = false;
state.pending = undefined;
try {
for (var i = 0, ii = pending.length; i < ii; ++i) {
markQStateExceptionHandled(state);
promise = pending[i][0];
fn = pendi... | @ngdoc method
@name ng.$q#defer
@kind function
@description
Creates a `Deferred` object which represents a task which will finish in the future.
@returns {Deferred} Returns a new instance of deferred. | processQueue | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function processChecks() {
// eslint-disable-next-line no-unmodified-loop-condition
while (!queueSize && checkQueue.length) {
var toCheck = checkQueue.shift();
if (!isStateExceptionHandled(toCheck)) {
markQStateExceptionHandled(toCheck);
var errorMessage = 'Possibly unhandled rejecti... | @ngdoc method
@name ng.$q#defer
@kind function
@description
Creates a `Deferred` object which represents a task which will finish in the future.
@returns {Deferred} Returns a new instance of deferred. | processChecks | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function scheduleProcessQueue(state) {
if (errorOnUnhandledRejections && !state.pending && state.status === 2 && !isStateExceptionHandled(state)) {
if (queueSize === 0 && checkQueue.length === 0) {
nextTick(processChecks);
}
checkQueue.push(state);
}
if (state.processScheduled || !... | @ngdoc method
@name ng.$q#defer
@kind function
@description
Creates a `Deferred` object which represents a task which will finish in the future.
@returns {Deferred} Returns a new instance of deferred. | scheduleProcessQueue | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function resolvePromise(promise, val) {
if (promise.$$state.status) return;
if (val === promise) {
$$reject(promise, $qMinErr(
'qcycle',
'Expected promise to be resolved with value other than itself \'{0}\'',
val));
} else {
$$resolve(promise, val);
}
} | @ngdoc method
@name ng.$q#defer
@kind function
@description
Creates a `Deferred` object which represents a task which will finish in the future.
@returns {Deferred} Returns a new instance of deferred. | resolvePromise | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function $$resolve(promise, val) {
var then;
var done = false;
try {
if (isObject(val) || isFunction(val)) then = val.then;
if (isFunction(then)) {
promise.$$state.status = -1;
then.call(val, doResolve, doReject, doNotify);
} else {
promise.$$state.value = val;
... | @ngdoc method
@name ng.$q#defer
@kind function
@description
Creates a `Deferred` object which represents a task which will finish in the future.
@returns {Deferred} Returns a new instance of deferred. | $$resolve | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function doResolve(val) {
if (done) return;
done = true;
$$resolve(promise, val);
} | @ngdoc method
@name ng.$q#defer
@kind function
@description
Creates a `Deferred` object which represents a task which will finish in the future.
@returns {Deferred} Returns a new instance of deferred. | doResolve | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function doReject(val) {
if (done) return;
done = true;
$$reject(promise, val);
} | @ngdoc method
@name ng.$q#defer
@kind function
@description
Creates a `Deferred` object which represents a task which will finish in the future.
@returns {Deferred} Returns a new instance of deferred. | doReject | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function doNotify(progress) {
notifyPromise(promise, progress);
} | @ngdoc method
@name ng.$q#defer
@kind function
@description
Creates a `Deferred` object which represents a task which will finish in the future.
@returns {Deferred} Returns a new instance of deferred. | doNotify | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function rejectPromise(promise, reason) {
if (promise.$$state.status) return;
$$reject(promise, reason);
} | @ngdoc method
@name ng.$q#defer
@kind function
@description
Creates a `Deferred` object which represents a task which will finish in the future.
@returns {Deferred} Returns a new instance of deferred. | rejectPromise | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function $$reject(promise, reason) {
promise.$$state.value = reason;
promise.$$state.status = 2;
scheduleProcessQueue(promise.$$state);
} | @ngdoc method
@name ng.$q#defer
@kind function
@description
Creates a `Deferred` object which represents a task which will finish in the future.
@returns {Deferred} Returns a new instance of deferred. | $$reject | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function notifyPromise(promise, progress) {
var callbacks = promise.$$state.pending;
if ((promise.$$state.status <= 0) && callbacks && callbacks.length) {
nextTick(function() {
var callback, result;
for (var i = 0, ii = callbacks.length; i < ii; i++) {
result = callbacks[i][0];
... | @ngdoc method
@name ng.$q#defer
@kind function
@description
Creates a `Deferred` object which represents a task which will finish in the future.
@returns {Deferred} Returns a new instance of deferred. | notifyPromise | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function reject(reason) {
var result = new Promise();
rejectPromise(result, reason);
return result;
} | @ngdoc method
@name $q#reject
@kind function
@description
Creates a promise that is resolved as rejected with the specified `reason`. This api should be
used to forward rejection in a chain of promises. If you are dealing with the last promise in
a promise chain, you don't need to worry about it.
When comparing defer... | reject | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function handleCallback(value, resolver, callback) {
var callbackOutput = null;
try {
if (isFunction(callback)) callbackOutput = callback();
} catch (e) {
return reject(e);
}
if (isPromiseLike(callbackOutput)) {
return callbackOutput.then(function() {
return resolver(value)... | @ngdoc method
@name $q#reject
@kind function
@description
Creates a promise that is resolved as rejected with the specified `reason`. This api should be
used to forward rejection in a chain of promises. If you are dealing with the last promise in
a promise chain, you don't need to worry about it.
When comparing defer... | handleCallback | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function when(value, callback, errback, progressBack) {
var result = new Promise();
resolvePromise(result, value);
return result.then(callback, errback, progressBack);
} | @ngdoc method
@name $q#when
@kind function
@description
Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise.
This is useful when you are dealing with an object that might or might not be a promise, or if
the promise comes from a source that can't be trusted.
@param {*} value Val... | when | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function all(promises) {
var result = new Promise(),
counter = 0,
results = isArray(promises) ? [] : {};
forEach(promises, function(promise, key) {
counter++;
when(promise).then(function(value) {
results[key] = value;
if (!(--counter)) resolvePromise(result, results)... | @ngdoc method
@name $q#all
@kind function
@description
Combines multiple promises into a single promise that is resolved when all of the input
promises are resolved.
@param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises.
@returns {Promise} Returns a single promise that will be resolved with ... | all | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function race(promises) {
var deferred = defer();
forEach(promises, function(promise) {
when(promise).then(deferred.resolve, deferred.reject);
});
return deferred.promise;
} | @ngdoc method
@name $q#race
@kind function
@description
Returns a promise that resolves or rejects as soon as one of those promises
resolves or rejects, with the value or reason from that promise.
@param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises.
@returns {Promise} a promise that resolv... | race | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function $Q(resolver) {
if (!isFunction(resolver)) {
throw $qMinErr('norslvr', 'Expected resolverFn, got \'{0}\'', resolver);
}
var promise = new Promise();
function resolveFn(value) {
resolvePromise(promise, value);
}
function rejectFn(reason) {
rejectPromise(promise, reaso... | @ngdoc method
@name $q#race
@kind function
@description
Returns a promise that resolves or rejects as soon as one of those promises
resolves or rejects, with the value or reason from that promise.
@param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises.
@returns {Promise} a promise that resolv... | $Q | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function resolveFn(value) {
resolvePromise(promise, value);
} | @ngdoc method
@name $q#race
@kind function
@description
Returns a promise that resolves or rejects as soon as one of those promises
resolves or rejects, with the value or reason from that promise.
@param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises.
@returns {Promise} a promise that resolv... | resolveFn | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function rejectFn(reason) {
rejectPromise(promise, reason);
} | @ngdoc method
@name $q#race
@kind function
@description
Returns a promise that resolves or rejects as soon as one of those promises
resolves or rejects, with the value or reason from that promise.
@param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises.
@returns {Promise} a promise that resolv... | rejectFn | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function isStateExceptionHandled(state) {
return !!state.pur;
} | @ngdoc method
@name $q#race
@kind function
@description
Returns a promise that resolves or rejects as soon as one of those promises
resolves or rejects, with the value or reason from that promise.
@param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises.
@returns {Promise} a promise that resolv... | isStateExceptionHandled | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function markQStateExceptionHandled(state) {
state.pur = true;
} | @ngdoc method
@name $q#race
@kind function
@description
Returns a promise that resolves or rejects as soon as one of those promises
resolves or rejects, with the value or reason from that promise.
@param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises.
@returns {Promise} a promise that resolv... | markQStateExceptionHandled | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function markQExceptionHandled(q) {
// Built-in `$q` promises will always have a `$$state` property. This check is to allow
// overwriting `$q` with a different promise library (e.g. Bluebird + angular-bluebird-promises).
// (Currently, this is the only method that might be called with a promise, even if it is no... | @ngdoc method
@name $q#race
@kind function
@description
Returns a promise that resolves or rejects as soon as one of those promises
resolves or rejects, with the value or reason from that promise.
@param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises.
@returns {Promise} a promise that resolv... | markQExceptionHandled | javascript | angular/angular.js | src/ng/q.js | https://github.com/angular/angular.js/blob/master/src/ng/q.js | MIT |
function $RootScopeProvider() {
var TTL = 10;
var $rootScopeMinErr = minErr('$rootScope');
var lastDirtyWatch = null;
var applyAsyncId = null;
this.digestTtl = function(value) {
if (arguments.length) {
TTL = value;
}
return TTL;
};
function createChildScopeClass(parent) {
function ... | @ngdoc service
@name $rootScope
@this
@description
Every application has a single root {@link ng.$rootScope.Scope scope}.
All other scopes are descendant scopes of the root scope. Scopes provide separation
between the model and the view, via a mechanism for watching the model for changes.
They also provide event emis... | $RootScopeProvider | javascript | angular/angular.js | src/ng/rootScope.js | https://github.com/angular/angular.js/blob/master/src/ng/rootScope.js | MIT |
function createChildScopeClass(parent) {
function ChildScope() {
this.$$watchers = this.$$nextSibling =
this.$$childHead = this.$$childTail = null;
this.$$listeners = {};
this.$$listenerCount = {};
this.$$watchersCount = 0;
this.$id = nextUid();
this.$$ChildScope = null... | @ngdoc service
@name $rootScope
@this
@description
Every application has a single root {@link ng.$rootScope.Scope scope}.
All other scopes are descendant scopes of the root scope. Scopes provide separation
between the model and the view, via a mechanism for watching the model for changes.
They also provide event emis... | createChildScopeClass | javascript | angular/angular.js | src/ng/rootScope.js | https://github.com/angular/angular.js/blob/master/src/ng/rootScope.js | MIT |
function ChildScope() {
this.$$watchers = this.$$nextSibling =
this.$$childHead = this.$$childTail = null;
this.$$listeners = {};
this.$$listenerCount = {};
this.$$watchersCount = 0;
this.$id = nextUid();
this.$$ChildScope = null;
this.$$suspended = false;
} | @ngdoc service
@name $rootScope
@this
@description
Every application has a single root {@link ng.$rootScope.Scope scope}.
All other scopes are descendant scopes of the root scope. Scopes provide separation
between the model and the view, via a mechanism for watching the model for changes.
They also provide event emis... | ChildScope | javascript | angular/angular.js | src/ng/rootScope.js | https://github.com/angular/angular.js/blob/master/src/ng/rootScope.js | MIT |
function destroyChildScope($event) {
$event.currentScope.$$destroyed = true;
} | @ngdoc service
@name $rootScope
@this
@description
Every application has a single root {@link ng.$rootScope.Scope scope}.
All other scopes are descendant scopes of the root scope. Scopes provide separation
between the model and the view, via a mechanism for watching the model for changes.
They also provide event emis... | destroyChildScope | javascript | angular/angular.js | src/ng/rootScope.js | https://github.com/angular/angular.js/blob/master/src/ng/rootScope.js | MIT |
function cleanUpScope($scope) {
// Support: IE 9 only
if (msie === 9) {
// There is a memory leak in IE9 if all child scopes are not disconnected
// completely when a scope is destroyed. So this code will recurse up through
// all this scopes children
//
// See issue... | @ngdoc service
@name $rootScope
@this
@description
Every application has a single root {@link ng.$rootScope.Scope scope}.
All other scopes are descendant scopes of the root scope. Scopes provide separation
between the model and the view, via a mechanism for watching the model for changes.
They also provide event emis... | cleanUpScope | javascript | angular/angular.js | src/ng/rootScope.js | https://github.com/angular/angular.js/blob/master/src/ng/rootScope.js | MIT |
function Scope() {
this.$id = nextUid();
this.$$phase = this.$parent = this.$$watchers =
this.$$nextSibling = this.$$prevSibling =
this.$$childHead = this.$$childTail = null;
this.$root = this;
this.$$destroyed = false;
this.$$suspended = false;
... | @ngdoc type
@name $rootScope.Scope
@description
A root scope can be retrieved using the {@link ng.$rootScope $rootScope} key from the
{@link auto.$injector $injector}. Child scopes are created using the
{@link ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when
compiled HTML template i... | Scope | javascript | angular/angular.js | src/ng/rootScope.js | https://github.com/angular/angular.js/blob/master/src/ng/rootScope.js | MIT |
function watchGroupAction() {
changeReactionScheduled = false;
try {
if (firstRun) {
firstRun = false;
listener(newValues, newValues, self);
} else {
listener(newValues, oldValues, self);
}
} finally {
... | @ngdoc method
@name $rootScope.Scope#$watchGroup
@kind function
@description
A variant of {@link ng.$rootScope.Scope#$watch $watch()} where it watches an array of `watchExpressions`.
If any one expression in the collection changes the `listener` is executed.
- The items in the `watchExpressions` array are observed vi... | watchGroupAction | javascript | angular/angular.js | src/ng/rootScope.js | https://github.com/angular/angular.js/blob/master/src/ng/rootScope.js | MIT |
function $watchCollectionInterceptor(_value) {
newValue = _value;
var newLength, key, bothNaN, newItem, oldItem;
// If the new value is undefined, then return undefined as the watch may be a one-time watch
if (isUndefined(newValue)) return;
if (!isObject(newValue)) { ... | @ngdoc method
@name $rootScope.Scope#$watchCollection
@kind function
@description
Shallow watches the properties of an object and fires whenever any of the properties change
(for arrays, this implies watching the array items; for object maps, this implies watching
the properties). If a change is detected, the `listene... | $watchCollectionInterceptor | javascript | angular/angular.js | src/ng/rootScope.js | https://github.com/angular/angular.js/blob/master/src/ng/rootScope.js | MIT |
function $watchCollectionAction() {
if (initRun) {
initRun = false;
listener(newValue, newValue, self);
} else {
listener(newValue, veryOldValue, self);
}
// make a copy for the next time a collection is changed
if (trackVeryOldValue... | @ngdoc method
@name $rootScope.Scope#$watchCollection
@kind function
@description
Shallow watches the properties of an object and fires whenever any of the properties change
(for arrays, this implies watching the array items; for object maps, this implies watching
the properties). If a change is detected, the `listene... | $watchCollectionAction | javascript | angular/angular.js | src/ng/rootScope.js | https://github.com/angular/angular.js/blob/master/src/ng/rootScope.js | MIT |
function flushApplyAsync() {
while (applyAsyncQueue.length) {
try {
applyAsyncQueue.shift()();
} catch (e) {
$exceptionHandler(e);
}
}
applyAsyncId = null;
} | function used as an initial value for watchers.
because it's unique we can easily tell it apart from other values | flushApplyAsync | javascript | angular/angular.js | src/ng/rootScope.js | https://github.com/angular/angular.js/blob/master/src/ng/rootScope.js | MIT |
function scheduleApplyAsync() {
if (applyAsyncId === null) {
applyAsyncId = $browser.defer(function() {
$rootScope.$apply(flushApplyAsync);
}, null, '$applyAsync');
}
} | function used as an initial value for watchers.
because it's unique we can easily tell it apart from other values | scheduleApplyAsync | javascript | angular/angular.js | src/ng/rootScope.js | https://github.com/angular/angular.js/blob/master/src/ng/rootScope.js | MIT |
function $$SanitizeUriProvider() {
var aHrefSanitizationTrustedUrlList = /^\s*(https?|s?ftp|mailto|tel|file):/,
imgSrcSanitizationTrustedUrlList = /^\s*((https?|ftp|file|blob):|data:image\/)/;
/**
* @description
* Retrieves or overrides the default regular expression that is used for determining trusted... | @this
@description
Private service to sanitize uris for links and images. Used by $compile and $sanitize. | $$SanitizeUriProvider | javascript | angular/angular.js | src/ng/sanitizeUri.js | https://github.com/angular/angular.js/blob/master/src/ng/sanitizeUri.js | MIT |
htmlSanitizer = function htmlSanitizer(html) {
throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');
} | @ngdoc method
@name $sceDelegateProvider#resourceUrlBlacklist
@kind function
@deprecated
sinceVersion="1.8.1"
This method is deprecated. Use {@link $sceDelegateProvider#bannedResourceUrlList
bannedResourceUrlList} instead. | htmlSanitizer | javascript | angular/angular.js | src/ng/sce.js | https://github.com/angular/angular.js/blob/master/src/ng/sce.js | MIT |
function matchUrl(matcher, parsedUrl) {
if (matcher === 'self') {
return urlIsSameOrigin(parsedUrl) || urlIsSameOriginAsBaseUrl(parsedUrl);
} else {
// definitely a regex. See adjustMatchers()
return !!matcher.exec(parsedUrl.href);
}
} | @ngdoc method
@name $sceDelegateProvider#resourceUrlBlacklist
@kind function
@deprecated
sinceVersion="1.8.1"
This method is deprecated. Use {@link $sceDelegateProvider#bannedResourceUrlList
bannedResourceUrlList} instead. | matchUrl | javascript | angular/angular.js | src/ng/sce.js | https://github.com/angular/angular.js/blob/master/src/ng/sce.js | MIT |
function isResourceUrlAllowedByPolicy(url) {
var parsedUrl = urlResolve(url.toString());
var i, n, allowed = false;
// Ensure that at least one item from the trusted resource URL list allows this url.
for (i = 0, n = trustedResourceUrlList.length; i < n; i++) {
if (matchUrl(trustedResour... | @ngdoc method
@name $sceDelegateProvider#resourceUrlBlacklist
@kind function
@deprecated
sinceVersion="1.8.1"
This method is deprecated. Use {@link $sceDelegateProvider#bannedResourceUrlList
bannedResourceUrlList} instead. | isResourceUrlAllowedByPolicy | javascript | angular/angular.js | src/ng/sce.js | https://github.com/angular/angular.js/blob/master/src/ng/sce.js | MIT |
function generateHolderType(Base) {
var holderType = function TrustedValueHolderType(trustedValue) {
this.$$unwrapTrustedValue = function() {
return trustedValue;
};
};
if (Base) {
holderType.prototype = new Base();
}
holderType.prototype.valueOf = functio... | @ngdoc method
@name $sceDelegateProvider#resourceUrlBlacklist
@kind function
@deprecated
sinceVersion="1.8.1"
This method is deprecated. Use {@link $sceDelegateProvider#bannedResourceUrlList
bannedResourceUrlList} instead. | generateHolderType | javascript | angular/angular.js | src/ng/sce.js | https://github.com/angular/angular.js/blob/master/src/ng/sce.js | MIT |
holderType = function TrustedValueHolderType(trustedValue) {
this.$$unwrapTrustedValue = function() {
return trustedValue;
};
} | @ngdoc method
@name $sceDelegateProvider#resourceUrlBlacklist
@kind function
@deprecated
sinceVersion="1.8.1"
This method is deprecated. Use {@link $sceDelegateProvider#bannedResourceUrlList
bannedResourceUrlList} instead. | holderType | javascript | angular/angular.js | src/ng/sce.js | https://github.com/angular/angular.js/blob/master/src/ng/sce.js | MIT |
function trustAs(type, trustedValue) {
var Constructor = (byType.hasOwnProperty(type) ? byType[type] : null);
if (!Constructor) {
throw $sceMinErr('icontext',
'Attempted to trust a value in invalid context. Context: {0}; Value: {1}',
type, trustedValue);
}
if (tru... | @ngdoc method
@name $sceDelegate#trustAs
@description
Returns a trusted representation of the parameter for the specified context. This trusted
object will later on be used as-is, without any security check, by bindings or directives
that require this security context.
For instance, marking a string as trusted for the... | trustAs | javascript | angular/angular.js | src/ng/sce.js | https://github.com/angular/angular.js/blob/master/src/ng/sce.js | MIT |
function valueOf(maybeTrusted) {
if (maybeTrusted instanceof trustedValueHolderBase) {
return maybeTrusted.$$unwrapTrustedValue();
} else {
return maybeTrusted;
}
} | @ngdoc method
@name $sceDelegate#valueOf
@description
If the passed parameter had been returned by a prior call to {@link ng.$sceDelegate#trustAs
`$sceDelegate.trustAs`}, returns the value that had been passed to {@link
ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}.
If the passed parameter is not a value that had b... | valueOf | javascript | angular/angular.js | src/ng/sce.js | https://github.com/angular/angular.js/blob/master/src/ng/sce.js | MIT |
function getTrusted(type, maybeTrusted) {
if (maybeTrusted === null || isUndefined(maybeTrusted) || maybeTrusted === '') {
return maybeTrusted;
}
var constructor = (byType.hasOwnProperty(type) ? byType[type] : null);
// If maybeTrusted is a trusted class instance or subclass instance, th... | @ngdoc method
@name $sceDelegate#getTrusted
@description
Given an object and a security context in which to assign it, returns a value that's safe to
use in this context, which was represented by the parameter. To do so, this function either
unwraps the safe type it has been given (for instance, a {@link ng.$sceDelega... | getTrusted | javascript | angular/angular.js | src/ng/sce.js | https://github.com/angular/angular.js/blob/master/src/ng/sce.js | MIT |
function $SnifferProvider() {
this.$get = ['$window', '$document', function($window, $document) {
var eventSupport = {},
// Chrome Packaged Apps are not allowed to access `history.pushState`.
// If not sandboxed, they can be detected by the presence of `chrome.app.runtime`
// (see https://... | !!! This is an undocumented "private" service !!!
@name $sniffer
@requires $window
@requires $document
@this
@property {boolean} history Does the browser support html5 history api ?
@property {boolean} transitions Does the browser support CSS transition events ?
@property {boolean} animations Does the browser support... | $SnifferProvider | javascript | angular/angular.js | src/ng/sniffer.js | https://github.com/angular/angular.js/blob/master/src/ng/sniffer.js | MIT |
function $$TaskTrackerFactoryProvider() {
this.$get = valueFn(function(log) { return new TaskTracker(log); });
} | ! This is a private undocumented service !
@name $$taskTrackerFactory
@description
A function to create `TaskTracker` instances.
A `TaskTracker` can keep track of pending tasks (grouped by type) and can notify interested
parties when all pending tasks (or tasks of a specific type) have been completed.
@param {$log} ... | $$TaskTrackerFactoryProvider | javascript | angular/angular.js | src/ng/taskTrackerFactory.js | https://github.com/angular/angular.js/blob/master/src/ng/taskTrackerFactory.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.