Commit graph

402 commits

Author SHA1 Message Date
Misko Hevery
2cb9497d02 Fixed issue where compiler would pass in detached text node if previous markup would have removed it. 2010-10-12 21:52:04 -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
fbfd160316 adding :package task to the rake file 2010-10-12 16:28:46 -07:00
Igor Minar
7ed2191b07 fixing missing semicolon 2010-10-12 14:48:59 -07:00
Igor Minar
451a711343 fix global namespace polution with invalidWidgets 2010-10-13 04:37:46 +08: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
Vojta Jina
3bd4abba6b Fixed calculator examples
* Fixed wrong reference to jquery library, and old method names (scope.$set, scope.$eval), added scope.$init() call...
* Changed to use angular-debug.js
* use simple assignments
2010-10-09 23:04:09 -07:00
Shyam Seshadri
8490bb921b Fix bug with Lexer not recognizing exponential values and values starting with dots 2010-10-08 20:41:19 -07:00
Misko Hevery
e3ea980c81 fixed leaking constants to gloabal scope 2010-10-08 16:25:12 -07:00
Misko Hevery
772e32c220 change ng:controller to create new scope hence allow nesting 2010-10-08 16:23:26 -07:00
Shyam Seshadri
c30807d141 Change angular-mocks to throw errors on unexpected gets in the format JSTD now expects 2010-10-07 09:34:22 -07:00
Igor Minar
a930e782a5 removing anchor spec and improving jqLite.trigger() method
- removing the last anchor spec because it can't run reliably in all browsers
- improving jqLite.trigger() method
2010-10-06 10:05:51 -07:00
Elliott Sprehn
8e40e7070d Fix bug in IE where clone removes whitespace nodes. 2010-10-05 07:12:13 +08:00
Igor Minar
81052d4a62 fixed lint warnings 2010-10-04 09:00:09 -07:00
Igor Minar
328ff6c926 adding missing spec for 'A' widget 2010-10-04 08:53:24 -07:00
Igor Minar
87f9a4c566 angular-mocks code should access all global functions via angular
mocks must use angular.foo because the final build will hide all
the normally accessible functions within an anonymous closure.
2010-10-01 16:06:32 -07:00
Igor Minar
8248e77a7b 'A' tag widget and ng:click propagation change
* added a widget for A (anchor) tag, that modifies the default behavior
  and prevent default action (location change and page reload) for tags
  with empty href attribute
* stopped event propagation for all ng:click handlers
2010-10-01 07:44:46 +08:00
Igor Minar
0af763dcec properly handle event's stopPropagation() and preventDefault() method in IE 2010-10-01 07:44:45 +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
Misko Hevery
9171a2b2b5 Added support for functions to $orderBy method
http://github.com/angular/angular.js/issues#issue/23
2010-09-26 19:43:39 +02:00
Misko Hevery
27868f17de cleanup underscore.js form rakefile 2010-09-23 13:53:38 +02:00
Bolek Szewczyk
0d5407bc1e make date validator use the Date object 2010-09-23 13:50:10 +02:00
Misko Hevery
db42221828 fix parseInt by adding radix so that it does not default to octal if the string starts with 0 2010-09-23 13:28:33 +02:00
Bolek Szewczyk
af030b888e delete unused files (e.g. swfobject and underscore libs) 2010-09-23 12:38:28 +02:00
Bolek Szewczyk
29f995fc78 remove TODO.text and add jstd.log to gitignore 2010-09-23 18:21:27 +08: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
Igor Minar
7cb7fb91c6 Add JSDoc for the copy() method 2010-09-23 17:19:26 +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
Alkis Evlogimenos
eefb920d0e Reduce copies done by Resource.
When a method foo is called on a Resource object, say myResource there are two copies that happen to the resource:
	- one inside Resource.foo() in some dummy function
	- another inside myResource.$foo() inside the callback passed to foo()
2010-09-22 09:14:50 +02:00
Misko Hevery
006fd2ca25 HEAD is now at 10c0151 Fixes on issue when a SELECT has OPTION which are data bound (ie OPTION has repeater or OPTION.value is bound), then SELECT does not update to match the correct OPTION after the change in model (ie after the OPTION repeater unrolls or OPTION.value is changed.) 2010-09-21 19:20:34 +02:00
Igor Minar
125d725e7d toJson should serialize inherited properties, but not any properties that start with $ 2010-09-21 16:27:47 +02:00
Misko Hevery
0d717310fd fixed test for ng:src which fails on IE, since IE treats undefined src as url to the current page. 2010-09-21 10:37:12 +02:00
Igor Minar
9dfdac2be2 Upgrade JsTestDriver to 1.2.2 sans annoying 'runTestConfiguration' logging 2010-09-21 10:06:49 +02:00
Igor Minar
558f22138c Upgrade closure compiler to the latest version 2010-09-21 10:05:11 +02:00
Alkis Evlogimenos
9627c4b50e Add ng:src and ng:href markup. 2010-09-20 11:57:50 +02:00
Alkis Evlogimenos
293f34cd64 Expose GET operations on resources as well. This allows us to read
"partials". The pattern is demostrated in the unittest:

Resource.query returns a list of "keys" to resources, which are
partially defined. They have enough data to allow $get to fetch the
whole gamout. Then $get fetches all the details of the resource.
2010-09-16 00:23:22 +02:00
Alkis Evlogimenos
b798ee80c2 Allow angular to be included with query parameters. This is a common
pattern for forcing a reload of the script in the browser irrespective
of the cache settings the host has.
2010-09-16 00:22:55 +02:00
Misko Hevery
21e78c443f Delete requests on resources pass this as data. Delete requests should not be passing data in the body of the response. The bug is here:
http://github.com/angular/angular.js/blob/master/src/Resource.js#L119

Instead of checking for !isGet you should be checking for !isPost. Also isPost should be isPostOrPut since only on those two methods should be sending a payload if I am not mistaken.
2010-09-16 00:20:35 +02:00
Misko Hevery
2acce6a334 removed unneeded comment 2010-09-16 00:20:35 +02:00
Misko Hevery
2a3a449c6d merge 2010-09-14 23:42:43 +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
07699b1a70 removed accidental assignment of $element to glabal space 2010-09-06 07:46:28 -07:00
Misko Hevery
9878355df7 remove Parser static 2010-08-18 18:15:19 -07:00
Misko Hevery
625f32b7eb converted lexer from function to closure 2010-08-18 17:50:21 -07:00
Misko Hevery
9632c99b0a move static field from Lexer to hidden namespace 2010-08-18 17:34:14 -07:00