mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-09 22:39:39 +08:00
Fixes a regression in ngAnimate introduced in 2f4437b3, whereby SVG elements would not be able to
have classes removed by ngAnimate methods when jQuery was loaded (without also including libraries
which patch jQuery to support SVG elements, such as jquery-svgdom.js).
This fix exports jqLiteHasClass as a private method `$$hasClass` on the `angular` global object,
which enables ngAnimate to use this SVG-safe method for testing if the class is available.
Closes #8872
Closes #8893
245 lines
6.9 KiB
JavaScript
245 lines
6.9 KiB
JavaScript
'use strict';
|
||
|
||
/* global angularModule: true,
|
||
version: true,
|
||
|
||
$LocaleProvider,
|
||
$CompileProvider,
|
||
|
||
htmlAnchorDirective,
|
||
inputDirective,
|
||
inputDirective,
|
||
formDirective,
|
||
scriptDirective,
|
||
selectDirective,
|
||
styleDirective,
|
||
optionDirective,
|
||
ngBindDirective,
|
||
ngBindHtmlDirective,
|
||
ngBindTemplateDirective,
|
||
ngClassDirective,
|
||
ngClassEvenDirective,
|
||
ngClassOddDirective,
|
||
ngCspDirective,
|
||
ngCloakDirective,
|
||
ngControllerDirective,
|
||
ngFormDirective,
|
||
ngHideDirective,
|
||
ngIfDirective,
|
||
ngIncludeDirective,
|
||
ngIncludeFillContentDirective,
|
||
ngInitDirective,
|
||
ngNonBindableDirective,
|
||
ngPluralizeDirective,
|
||
ngRepeatDirective,
|
||
ngShowDirective,
|
||
ngStyleDirective,
|
||
ngSwitchDirective,
|
||
ngSwitchWhenDirective,
|
||
ngSwitchDefaultDirective,
|
||
ngOptionsDirective,
|
||
ngTranscludeDirective,
|
||
ngModelDirective,
|
||
ngListDirective,
|
||
ngChangeDirective,
|
||
patternDirective,
|
||
patternDirective,
|
||
requiredDirective,
|
||
requiredDirective,
|
||
minlengthDirective,
|
||
minlengthDirective,
|
||
maxlengthDirective,
|
||
maxlengthDirective,
|
||
ngValueDirective,
|
||
ngModelOptionsDirective,
|
||
ngAttributeAliasDirectives,
|
||
ngEventDirectives,
|
||
|
||
$AnchorScrollProvider,
|
||
$AnimateProvider,
|
||
$BrowserProvider,
|
||
$CacheFactoryProvider,
|
||
$ControllerProvider,
|
||
$DocumentProvider,
|
||
$ExceptionHandlerProvider,
|
||
$FilterProvider,
|
||
$InterpolateProvider,
|
||
$IntervalProvider,
|
||
$HttpProvider,
|
||
$HttpBackendProvider,
|
||
$LocationProvider,
|
||
$LogProvider,
|
||
$ParseProvider,
|
||
$RootScopeProvider,
|
||
$QProvider,
|
||
$$QProvider,
|
||
$$SanitizeUriProvider,
|
||
$SceProvider,
|
||
$SceDelegateProvider,
|
||
$SnifferProvider,
|
||
$TemplateCacheProvider,
|
||
$TemplateRequestProvider,
|
||
$$TestabilityProvider,
|
||
$TimeoutProvider,
|
||
$$RAFProvider,
|
||
$$AsyncCallbackProvider,
|
||
$WindowProvider
|
||
*/
|
||
|
||
|
||
/**
|
||
* @ngdoc object
|
||
* @name angular.version
|
||
* @module ng
|
||
* @description
|
||
* An object that contains information about the current AngularJS version. This object has the
|
||
* following properties:
|
||
*
|
||
* - `full` – `{string}` – Full version string, such as "0.9.18".
|
||
* - `major` – `{number}` – Major version number, such as "0".
|
||
* - `minor` – `{number}` – Minor version number, such as "9".
|
||
* - `dot` – `{number}` – Dot version number, such as "18".
|
||
* - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
|
||
*/
|
||
var version = {
|
||
full: '"NG_VERSION_FULL"', // all of these placeholder strings will be replaced by grunt's
|
||
major: "NG_VERSION_MAJOR", // package task
|
||
minor: "NG_VERSION_MINOR",
|
||
dot: "NG_VERSION_DOT",
|
||
codeName: '"NG_VERSION_CODENAME"'
|
||
};
|
||
|
||
|
||
function publishExternalAPI(angular){
|
||
extend(angular, {
|
||
'bootstrap': bootstrap,
|
||
'copy': copy,
|
||
'extend': extend,
|
||
'equals': equals,
|
||
'element': jqLite,
|
||
'forEach': forEach,
|
||
'injector': createInjector,
|
||
'noop': noop,
|
||
'bind': bind,
|
||
'toJson': toJson,
|
||
'fromJson': fromJson,
|
||
'identity': identity,
|
||
'isUndefined': isUndefined,
|
||
'isDefined': isDefined,
|
||
'isString': isString,
|
||
'isFunction': isFunction,
|
||
'isObject': isObject,
|
||
'isNumber': isNumber,
|
||
'isElement': isElement,
|
||
'isArray': isArray,
|
||
'version': version,
|
||
'isDate': isDate,
|
||
'lowercase': lowercase,
|
||
'uppercase': uppercase,
|
||
'callbacks': {counter: 0},
|
||
'getTestability': getTestability,
|
||
'$$minErr': minErr,
|
||
'$$csp': csp,
|
||
'reloadWithDebugInfo': reloadWithDebugInfo,
|
||
'$$hasClass': jqLiteHasClass
|
||
});
|
||
|
||
angularModule = setupModuleLoader(window);
|
||
try {
|
||
angularModule('ngLocale');
|
||
} catch (e) {
|
||
angularModule('ngLocale', []).provider('$locale', $LocaleProvider);
|
||
}
|
||
|
||
angularModule('ng', ['ngLocale'], ['$provide',
|
||
function ngModule($provide) {
|
||
// $$sanitizeUriProvider needs to be before $compileProvider as it is used by it.
|
||
$provide.provider({
|
||
$$sanitizeUri: $$SanitizeUriProvider
|
||
});
|
||
$provide.provider('$compile', $CompileProvider).
|
||
directive({
|
||
a: htmlAnchorDirective,
|
||
input: inputDirective,
|
||
textarea: inputDirective,
|
||
form: formDirective,
|
||
script: scriptDirective,
|
||
select: selectDirective,
|
||
style: styleDirective,
|
||
option: optionDirective,
|
||
ngBind: ngBindDirective,
|
||
ngBindHtml: ngBindHtmlDirective,
|
||
ngBindTemplate: ngBindTemplateDirective,
|
||
ngClass: ngClassDirective,
|
||
ngClassEven: ngClassEvenDirective,
|
||
ngClassOdd: ngClassOddDirective,
|
||
ngCloak: ngCloakDirective,
|
||
ngController: ngControllerDirective,
|
||
ngForm: ngFormDirective,
|
||
ngHide: ngHideDirective,
|
||
ngIf: ngIfDirective,
|
||
ngInclude: ngIncludeDirective,
|
||
ngInit: ngInitDirective,
|
||
ngNonBindable: ngNonBindableDirective,
|
||
ngPluralize: ngPluralizeDirective,
|
||
ngRepeat: ngRepeatDirective,
|
||
ngShow: ngShowDirective,
|
||
ngStyle: ngStyleDirective,
|
||
ngSwitch: ngSwitchDirective,
|
||
ngSwitchWhen: ngSwitchWhenDirective,
|
||
ngSwitchDefault: ngSwitchDefaultDirective,
|
||
ngOptions: ngOptionsDirective,
|
||
ngTransclude: ngTranscludeDirective,
|
||
ngModel: ngModelDirective,
|
||
ngList: ngListDirective,
|
||
ngChange: ngChangeDirective,
|
||
pattern: patternDirective,
|
||
ngPattern: patternDirective,
|
||
required: requiredDirective,
|
||
ngRequired: requiredDirective,
|
||
minlength: minlengthDirective,
|
||
ngMinlength: minlengthDirective,
|
||
maxlength: maxlengthDirective,
|
||
ngMaxlength: maxlengthDirective,
|
||
ngValue: ngValueDirective,
|
||
ngModelOptions: ngModelOptionsDirective
|
||
}).
|
||
directive({
|
||
ngInclude: ngIncludeFillContentDirective
|
||
}).
|
||
directive(ngAttributeAliasDirectives).
|
||
directive(ngEventDirectives);
|
||
$provide.provider({
|
||
$anchorScroll: $AnchorScrollProvider,
|
||
$animate: $AnimateProvider,
|
||
$browser: $BrowserProvider,
|
||
$cacheFactory: $CacheFactoryProvider,
|
||
$controller: $ControllerProvider,
|
||
$document: $DocumentProvider,
|
||
$exceptionHandler: $ExceptionHandlerProvider,
|
||
$filter: $FilterProvider,
|
||
$interpolate: $InterpolateProvider,
|
||
$interval: $IntervalProvider,
|
||
$http: $HttpProvider,
|
||
$httpBackend: $HttpBackendProvider,
|
||
$location: $LocationProvider,
|
||
$log: $LogProvider,
|
||
$parse: $ParseProvider,
|
||
$rootScope: $RootScopeProvider,
|
||
$q: $QProvider,
|
||
$$q: $$QProvider,
|
||
$sce: $SceProvider,
|
||
$sceDelegate: $SceDelegateProvider,
|
||
$sniffer: $SnifferProvider,
|
||
$templateCache: $TemplateCacheProvider,
|
||
$templateRequest: $TemplateRequestProvider,
|
||
$$testability: $$TestabilityProvider,
|
||
$timeout: $TimeoutProvider,
|
||
$window: $WindowProvider,
|
||
$$rAF: $$RAFProvider,
|
||
$$asyncCallback : $$AsyncCallbackProvider
|
||
});
|
||
}
|
||
]);
|
||
}
|