Commit graph

51 commits

Author SHA1 Message Date
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
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
Misko Hevery
aaabeb8c5e fixed more ie test failures 2010-10-20 23:51:49 -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
Vojta Jina
d0e55bf446 Removed $location.cancel() method (and related test) 2010-10-18 14:13:48 -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
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
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
eb8d46d380 Differentiate between flags and empty keys in $location.hashSearch
* #foo?key=var&flag&emptyKey= should parse into
  {key:'val', flag: true, emptyKey: ''}
* added docs and spec for parseKeyValue function
2010-09-29 09:52:03 -07: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
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
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
0f4b068bd6 fix test 2010-07-20 17:03:34 -07:00
Misko Hevery
87cfc27be3 changed remaining ng- to ng: 2010-07-13 11:20:11 -07:00
Shyam Seshadri
42257f22af wilford's changes to serve cached data and then fetch from server if needed / specified 2010-06-23 13:07:31 -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
Misko Hevery
0f73084e9d added error handler to xhr requests 2010-05-19 11:51:17 -07:00
Misko Hevery
4b9b9e9830 fix incorect parsing of url if it contains dash - character 2010-05-13 12:03:10 -07:00
Misko Hevery
f5027cc375 Merge branch 'master' of github.com:angular/angular.js 2010-05-10 10:36:06 -07:00
Misko Hevery
4542716370 lint 2010-05-10 10:36:02 -07:00
Misko Hevery
038a743e6f xhr bulk fixes 2010-05-07 12:09:14 -07:00
Misko Hevery
549ff73a9b clear cache on non-get 2010-04-30 10:27:41 -07:00
Misko Hevery
c7913a4b7a added $xhr service with bulk and cache, hooked up $resource 2010-04-29 17:28:33 -07:00
Misko Hevery
913729ee01 fix isssue where the jasmine currentSpec does not get updated and hence everything runs as last spec context. 2010-04-29 10:55:22 -07:00
Misko Hevery
deb86fe357 lots of small fixes 2010-04-16 14:01:29 -07:00
Misko Hevery
70e401ef10 added $route service 2010-04-15 14:17:33 -07:00
Misko Hevery
7c49b25548 $invalid widget clear on switch change 2010-04-12 19:05:39 -07:00
Misko Hevery
843bd355d2 various bug fixes 2010-04-09 16:20:15 -07:00
Misko Hevery
41a5c408c2 tests pass jstd has issues 2010-04-08 15:05:05 -07:00
Misko Hevery
c4ef1f2fdd tests failing jstd to show cory 2010-04-08 13:43:40 -07:00
Misko Hevery
6ea1ac7b05 added $invalidWidget service 2010-04-07 14:13:10 -07:00
Misko Hevery
7a4b480206 added ng:switch widget 2010-04-05 11:46:53 -07:00
Misko Hevery
5dcf9bb4fe browser is now injectable into the system 2010-04-03 20:23:16 -07:00
Misko Hevery
a80a61839a injection is now working 2010-04-03 17:04:36 -07:00
Misko Hevery
5bd23fde7a merge 2010-04-02 11:16:49 -07:00
Misko Hevery
d717020911 widgets now work properly 2010-04-02 11:10:36 -07:00
Misko Hevery
85f13d602e work on $location and autobind 2010-04-01 14:10:28 -07:00
Misko Hevery
11a6431f89 started to add services 2010-03-31 18:18:10 -07:00