2011-07-17 08:05:43 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
2010-04-05 18:46:53 +00:00
|
|
|
var browserSingleton;
|
2011-08-10 09:51:24 +00:00
|
|
|
|
2010-09-22 21:37:17 +00:00
|
|
|
angularService('$browser', function($log){
|
2010-04-05 18:46:53 +00:00
|
|
|
if (!browserSingleton) {
|
2011-01-05 01:54:37 +00:00
|
|
|
browserSingleton = new Browser(window, jqLite(window.document), jqLite(window.document.body),
|
|
|
|
|
XHR, $log);
|
2010-04-06 03:53:33 +00:00
|
|
|
browserSingleton.bind();
|
2010-04-05 18:46:53 +00:00
|
|
|
}
|
|
|
|
|
return browserSingleton;
|
2010-12-09 00:52:08 +00:00
|
|
|
}, {$inject:['$log']});
|
2010-04-05 18:46:53 +00:00
|
|
|
|
2011-07-12 00:31:29 +00:00
|
|
|
|
2010-04-05 18:46:53 +00:00
|
|
|
extend(angular, {
|
2011-04-18 23:33:30 +00:00
|
|
|
// disabled for now until we agree on public name
|
|
|
|
|
//'annotate': annotate,
|
2010-04-05 18:46:53 +00:00
|
|
|
'element': jqLite,
|
|
|
|
|
'compile': compile,
|
|
|
|
|
'scope': createScope,
|
|
|
|
|
'copy': copy,
|
|
|
|
|
'extend': extend,
|
2010-07-19 19:29:24 +00:00
|
|
|
'equals': equals,
|
2011-01-08 06:02:23 +00:00
|
|
|
'forEach': forEach,
|
Introduced injector and $new to scope, and injection into link methods and controllers
- added angular.injector(scope, services, instanceCache) which returns inject
- inject method can return, instance, or call function which have $inject
property
- initialize services with $creation=[eager|eager-publish] this means that
only some of the services are now globally accessible
- upgraded $become on scope to use injector hence respect the $inject property
for injection
- $become should not be run multiple times and will most likely be removed
in future version
- added $new on scope to create a child scope
- $inject is respected on constructor function
- simplified scopes so that they no longer have separate __proto__ for
parent, api, behavior and instance this should speed up execution since
scope will now create one __proto__ chain per scope (not three).
BACKWARD COMPATIBILITY WARNING:
- services now need to have $inject instead of inject property for proper
injection this breaks backward compatibility
- not all services are now published into root scope
(only: $location, $cookie, $window)
- if you have widget/directive which uses services on scope
(such as this.$xhr), you will now have to inject that service in
(as it is not published on the root scope anymore)
2010-10-09 00:30:13 +00:00
|
|
|
'injector': createInjector,
|
2010-04-05 18:46:53 +00:00
|
|
|
'noop':noop,
|
2010-04-15 21:17:33 +00:00
|
|
|
'bind':bind,
|
2010-07-20 23:55:32 +00:00
|
|
|
'toJson': toJson,
|
|
|
|
|
'fromJson': fromJson,
|
2010-04-05 18:46:53 +00:00
|
|
|
'identity':identity,
|
|
|
|
|
'isUndefined': isUndefined,
|
|
|
|
|
'isDefined': isDefined,
|
|
|
|
|
'isString': isString,
|
|
|
|
|
'isFunction': isFunction,
|
2010-05-07 19:09:14 +00:00
|
|
|
'isObject': isObject,
|
2010-04-05 18:46:53 +00:00
|
|
|
'isNumber': isNumber,
|
2011-07-12 00:31:29 +00:00
|
|
|
'isArray': isArray,
|
|
|
|
|
'version': version
|
2010-04-05 18:46:53 +00:00
|
|
|
});
|
|
|
|
|
|
2011-02-05 00:42:21 +00:00
|
|
|
//try to bind to jquery now so that one can write angular.element().read()
|
|
|
|
|
//but we will rebind on bootstrap again.
|
|
|
|
|
bindJQuery();
|
|
|
|
|
|
|
|
|
|
|