Commit graph

76 commits

Author SHA1 Message Date
Igor Minar
e7a0fb250f fromJson delegation to native JSON parser if available
- native parser delegation
- $xhr change to use native parser
2010-12-22 14:16:36 -08:00
Igor Minar
b370fac4fc $defer service should always call $eval after callback finished
Closes #189
2010-12-10 13:22:44 -08:00
Igor Minar
824eab9029 improving $resource docs 2010-12-07 16:06:31 -08:00
Igor Minar
011fa39c2a add $browser.defer and $defer service and fix async xhr cache issue
- Closes #152 ($resource().query() sometimes calls callback before
  returning, and it shouldn't)
- add $browser.defer method
- add $defer service
- integrate $browser.defer with outstandingRequests counter in $browser
- fix all old tests that relied on buggy behavior
2010-12-06 16:45:59 -08:00
Igor Minar
aa21c521eb more docs for angular.service. 2010-11-25 09:50:07 -08:00
Vojta Jina
47f159cdf3 Doc service: added example into service overview 2010-11-25 08:51:26 -08:00
Igor Minar
50ef1f8e35 don't escape $ in hashpath either 2010-11-18 22:40:00 -08:00
Igor Minar
66c0bfaa8e don't escape ! and : in hashPath
This is a temporary fix for Issue #158
2010-11-18 20:51:31 -08:00
Igor Minar
1719b0aca5 fix all closure compilation warnings due to invalid function types 2010-11-18 17:03:43 -08:00
Igor Minar
fc7f11d03b add @workInProgress tag and mark all @ngdocs as work in progress 2010-11-18 16:28:42 -08:00
Igor Minar
a6978b201b make @param type and description non-optional 2010-11-18 02:35:28 -08:00
Igor Minar
4c69d694d7 make @returns type non-optional 2010-11-18 02:34:53 -08:00
Misko Hevery
b2d63ac48b Changed error handling so that better stack traces are displayed in the ng-errors 2010-11-16 14:19:55 -08:00
Vojta Jina
cc749760fd Added basic Services, which support @memberOf and @methodOf 2010-11-15 21:55:37 -08:00
Vojta Jina
2d61040fb0 Small refactor in $location service
Added new inner method updateLastLocation()
2010-10-31 21:37:54 -07:00
Vojta Jina
99f25050a3 Fixing issue #98 (infinite loop when location hash set empty)
Added tests and fixed the issue.

Closes #98
2010-10-31 21:37:33 -07:00
Igor Minar
833e0ae343 $cookieStore should not be a global service
you must use $inject to $inject it as any other non-global service
2010-10-23 14:22:30 -07:00
Vojta Jina
a27198d52e Added tests for URL_MATCH and fixed issue with empty path
This commit was produced by a combination of 4 commits:
- Added URL_MATCH test for basic url
- Moved two tests from $location to URL_MATCH, as they should be here
- Added test for host without "/" ending and fix the regexp to pass the test
- Added another test for matching empty abs path ("/") and fix the regexp
2010-10-19 21:58:01 -07:00
Igor Minar
a1fa23397f small fixes to the $location services
* fixing the jsdoc format
* rewriting updateHash() method to be easier to read and so that
  it minifies better
2010-10-18 22:24:44 -07:00
Vojta Jina
d0e55bf446 Removed $location.cancel() method (and related test) 2010-10-18 14:13:48 -07:00
Vojta Jina
1cad16c6f9 Update $location API Close #62
update(objOrString)
updateHash(objOrString [, objOrString])
toString()
cancel()

Examples:
$location.update('http://www.angularjs.org/path#path?a=b');
$location.update({port: 443, protocol: 'https'});
$location.updateHash('hashPath');
$location.updateHash({a: 'b'});
$location.updateHash('hashPath', {a: 'b'});

This commit was produced by squash of more commits, here are the old messages:

- Change tests to use update() instead of parse().
- First implementation of update() method
- Test for update() with object parameter
- Add new tests for location, refactor location code
- Add tests for updateHash()
- Implement updateHash()
- Take one or two arguments, could be string - update hashPath, or hash object - update hashSearch...
- Fixed other service tests, to use new $location.update()
Added $location.cancel() method (with test)
Added $location.parse() for back compatability
Remove parse() method
2010-10-18 10:04:15 -07:00
Vojta Jina
341b2b3a9b Update $location API Close #62
update(objOrString)
updateHash(objOrString [, objOrString])
toString()
cancel()

Examples:
$location.update('http://www.angularjs.org/path#path?a=b');
$location.update({port: 443, protocol: 'https'});
$location.updateHash('hashPath');
$location.updateHash({a: 'b'});
$location.updateHash('hashPath', {a: 'b'});

This commit was produced by squash of more commits, here are the old messages:

- Change tests to use update() instead of parse().
- First implementation of update() method
- Test for update() with object parameter
- Add new tests for location, refactor location code
- Add tests for updateHash()
- Implement updateHash()
- Take one or two arguments, could be string - update hashPath, or hash object - update hashSearch...
- Fixed other service tests, to use new $location.update()
Added $location.cancel() method (with test)
Added $location.parse() for back compatability
Remove parse() method
2010-10-18 09:58:37 -07:00
Misko Hevery
a7da160c1d publish $route since we bind it with $route.current in ng:include 2010-10-14 15:44:14 -07:00
Misko Hevery
d9abfe8a7e 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-12 16:33:06 -07:00
Igor Minar
7ed2191b07 fixing missing semicolon 2010-10-12 14:48:59 -07:00
Igor Minar
70ff7a2639 fix memory leak caused by leftbehind $invalidWidgets references
- ng:switch should not clean up $invalidWidgets
- $invalidWidgets should be clean up after each eval
- add missing docs
2010-10-13 04:37:46 +08:00
Igor Minar
7e47a2d016 temparary backaward compatibility patch for Controller.init
- feedback relies on *Controller.init to be called when a Controller is
being created. this with previous angular refactoring this is not happening
in angular any more. To make it easier for feedback to transition, this
change makes $become call controller's init method if present.

- call to Controller.init from $route.updateRoute was removed. this was
left there by accident during the previous refactoring.
2010-10-13 04:37:45 +08:00
Igor Minar
984acdc627 Reworked the cookie synchronization between cookie service, $browser and document.cookie.
Now we finally correctly handle situations when browser refuses to set a cookie, due to
storage quota or other (file:// protocol) limitations.
2010-09-27 15:10:05 -07:00
Igor Minar
3eec8c1a51 Properly initialize cookie service in order to preserve existing cookies
- previously the poller initialized the cookie cache too late which
  was causing previously existing cookies to be deleted by cookie service
- refactored the poller api so that the addPollFn returns the added fn
- fixed older cookie service tests
- removed "this.$onEval(PRIORITY_LAST, update);" because it is not needed
2010-09-26 23:54:31 -07:00
Igor Minar
acbcfbaf30 $cookies service refactoring
- remove obsolete code in tests
- add warning logs when maximum cookie limits (as specified via RFC 2965) were reached
- non-string values will now get dropped
- after each update $cookies hash will reflect the actual state of browser cookies
  this means that if browser drops some cookies due to cookie overflow, $cookies will reflect that
- $sessionStore got renamed to $cookieStore to avoid name conflicts with html5's sessionStore
2010-09-23 17:23:52 +08:00
Igor Minar
a8931c9021 Rewrite session store service in object literal style and remove getAll method that is not used anywhere 2010-09-23 17:23:43 +08:00
Misko Hevery
0649009624 Refactored the Browser:
- change from using prototype to inner functions to help with better compression
  - removed watchers (url/cookie) and introduced a poller concept
  - moved the checking of URL and cookie into services which register with poolers
Benefits:
  - Smaller minified file
  - can call $browser.poll() from tests to simulate polling
  - single place where setTimeout needs to be tested
  - More testable $browser
2010-09-22 16:17:44 +02:00
Misko Hevery
2acce6a334 removed unneeded comment 2010-09-16 00:20:35 +02:00
Misko Hevery
894ffadc8c Fixed all trivial jslint violations 2010-09-14 23:22:15 +02:00
Misko Hevery
e3f760fbad Adding cookie service
- Browser.cookies()
  - MockBrowser
  - $cookie service
  - $sessionStore
2010-09-14 22:51:01 +02:00
Misko Hevery
5ddd8d9586 stringify names for better compression, remove dead functions, removed underscore.js compatibility 2010-08-18 17:26:33 -07:00
Misko Hevery
044ecb91c1 clean up for better obfuscation 2010-08-11 12:04:02 -07:00
Misko Hevery
4aac29da18 added additional test 2010-08-10 11:17:08 -07:00
Misko Hevery
1e1c8c82f9 minor speed improvements or URL parsing 2010-07-30 11:45:52 -07:00
Misko Hevery
cdda664f89 fix up the $location encoding 2010-07-30 10:56:36 -07:00
Misko Hevery
1b768b8443 refactored $location service so that it correctly updates under all conditions 2010-07-29 12:54:13 -07:00
Misko Hevery
8ddee9bb25 add $exceptionHandler service 2010-07-26 16:11:25 -07:00
Misko Hevery
748e91ba92 fixed some of the IE bugs 2010-07-23 11:38:52 -07:00
Misko Hevery
bebfbeac0a fixed xhtml compatibility, fix console in chrome 2010-07-20 16:55:32 -07:00
Rob Spies
4034a2d1e2 better naming for our verify cache scheme, and tests. 2010-07-13 14:09:53 -07:00
Rob Spies
1500e91def Merge http://github.com/angular/angular.js into angular
Conflicts:
	.gitignore
2010-06-22 17:09:55 -07:00
Andres Ornelas
cb5d211927 extracted switchRouteMatcher and added necessary libraries to angular-scenario 2010-05-27 11:26:23 -07:00
Misko Hevery
80bd0c273b fixed isNumber to angular.isNumber for mocks outside of angular 2010-05-19 16:00:20 -07:00
Misko Hevery
80e12276f4 added $log to console connection 2010-05-19 13:24:37 -07:00
Misko Hevery
31b35b141f added exception handling to $xhr 2010-05-19 12:00:44 -07:00