Commit graph

413 commits

Author SHA1 Message Date
Misko Hevery
a004d487c4 allow jquery to be declared after angular in the script loading order 2011-02-16 00:48:22 -05:00
Igor Minar
1777110958 split up services into individual files
- split up services into files under src/service
- split up specs into files under test/service
- rewrite all specs so that they don't depend on one global forEach
- get rid of obsolete code and tests in ng:switch
- rename mock $log spec from "$log" to "$log mock"
2011-02-15 11:01:53 -05:00
Igor Minar
e9ce22592a $resource should encode url params with encodeURIComponent 2011-02-10 17:57:42 -08:00
Igor Minar
86321d1f57 add support for hashSearch redirection and custom redirection functions 2011-02-07 23:56:33 -08:00
Igor Minar
8724e97b7e $route redirection should interpolate variables 2011-02-07 23:56:33 -08:00
Igor Minar
bf8013ad57 $location.updateHash should not preserve hashSearch when hashSearch is undefined 2011-02-07 23:56:32 -08:00
Igor Minar
ea9ca651d2 fix how redirection is handled and tested 2011-02-06 09:35:14 -08:00
Vojta Jina
9798f5e35f mock $log: fixed bug, added some tests
I extracted mock $log factory into stand alone function, so we can access it and test, because this service is rewritten by real service during testing, so we can't access it through angular.$service('$log')...
2011-02-04 14:18:28 -08:00
Igor Minar
fbc7f1b454 ng:view should be nestable in ng:include 2011-02-04 14:11:53 -08:00
Igor Minar
bf7c9d9900 $route.onChange should return the registered fn 2011-02-04 14:11:52 -08:00
Igor Minar
568574b915 mock's .xhr.flush() should throw exception when there is nothing to flush 2011-02-04 14:11:52 -08:00
Misko Hevery
46d690ff01 smarter normalization of value on option, and htmlParser fixes 2011-02-04 13:44:22 -08:00
Misko Hevery
d35c1ac8b0 Fixed notifyWhenNoOutstandingRequests() when using JSONP 2011-02-03 20:03:32 -08:00
Misko Hevery
b6a01bd27d fixed population of value attribute on option
The value attribute must be populated manually, since different
browsers default to different value of option when not explicitly
defined.
2011-02-03 13:25:01 -08:00
Misko Hevery
aaaad298ac corrected typo in the dump function which was preventig serialization of objects 2011-02-03 12:25:43 -08:00
Igor Minar
9fd3dfe49d add support for $route.reload()
Closes 254
2011-02-01 09:35:19 -08:00
Igor Minar
d7686a429c add $route.parent for setting parentScope 2011-02-01 09:35:19 -08:00
Igor Minar
6c0cf17404 add redirection support to $route
Closes #217
2011-02-01 09:35:19 -08:00
Igor Minar
c648fee5c2 fix $location to handle updates to empty hash well 2011-02-01 09:35:18 -08:00
Igor Minar
9462c78fbf $browser poller should notify $location only once per url change 2011-02-01 09:35:18 -08:00
Igor Minar
ce7ab3d1ee add support for 404 handling via $route.otherwise
Closes #217
2011-02-01 09:33:59 -08:00
Igor Minar
7db3b54c1f adding spec for controller-less $route definitions 2011-02-01 09:33:59 -08:00
Igor Minar
8682befc72 fix for stupid IE handling of named functions in mocks 2011-01-26 22:30:09 -08:00
Igor Minar
3f0a37f380 add missing test/mocks.js 2011-01-26 20:12:23 -08:00
Igor Minar
f5d08963b0 split mocks and create $log and $exceptionHandler mocks
- split mocks between angular-mocks.js and mocks.js
- src/angular-mocks.js now contains only mocks that we want to ship
- test/mocks.js contains mocks that we use internally for testing
  angular
- created angular.mock namespace
- created public $exceptionHandler mock rethrows errors
- created public $log mock stores all logs messages in an array that can
  be accessed to make assertions
- internally we now have factory to create $exceptionHandler
  that we can assert on
- internally we also keep track of all messages logged and
  fail tests if messages were not expected and cleaned up (checked
  via global beforeEach and afterEach)
- updated RakeFile and docs reader.js to point to the new
  angular-mocks.js location
- made real $exceptionHandler and $log factories accessible from tests
  and simplified their specs
- fixed typos in several spec descriptions
- added log assertions throughout the test suite
2011-01-26 15:46:05 -08:00
Igor Minar
9e0fa5b7c8 compile but don't bind option elements nested in a nameless select
otherwise an exception is thrown unexpectidly
2011-01-25 20:49:25 -08:00
Igor Minar
9368ea3814 Scope should retrieve $log and $exceptionHandler via $service
- fix $log and $exceptionHandler retrieval
- remove reference to non-existent `error` handler
- update tests
2011-01-25 20:49:25 -08:00
Misko Hevery
c2f2587a79 fixed example rendering, add tests for it. 2011-01-24 14:23:51 -08:00
Igor Minar
a5990050d4 ng:view should propagate evals to the current child scope
- this change is needed because of previously reverted $route changes
  that used to propagate evals automatically.
- also added docs to highlight how the eval propagation works
2011-01-24 14:03:43 -08:00
Igor Minar
8d507df8c9 Revert "$route should create child scope via $new"
This reverts commit a5eb3ed107.

See 9ca2facb for reasoning.
2011-01-24 14:03:42 -08:00
Igor Minar
567f33823b Revert "fix ng:include issue introduced by a5eb3ed1"
This reverts commit 17ee0f031a.

this and a5eb3ed1 introduced scope leakage that can't be resolved
until we fix up scope relationships and eval propagation.
I'm reverting both this and a5eb3ed1 until we can properly address
the issue.
2011-01-24 14:03:42 -08:00
Igor Minar
5340d1e0b1 fix for infinite loop in retrieveScope with jQuery + specs
- retrieveScope run into infinite loop if called on DOM tree
  that doesn't contain scope reference (happens only with jQuery)
- added missing specs for retrieveScope function
2011-01-24 14:03:42 -08:00
Igor Minar
94737cd017 $cookies service should not call $eval during $eval
- added comment
- removed $eval call
- changed the code to not require $eval
- updated specs
2011-01-24 14:03:41 -08:00
Igor Minar
4a569560d8 null and other falsy values should not be rendered in the view
Closes #242
2011-01-20 12:55:03 -08:00
Igor Minar
17ee0f031a fix ng:include issue introduced by a5eb3ed1 2011-01-19 21:47:14 -08:00
Igor Minar
10646c9f6f add ng:view widget 2011-01-19 15:53:59 -08:00
Igor Minar
a5eb3ed107 $route should create child scope via $new 2011-01-19 15:52:27 -08:00
Misko Hevery
459a01e582 improved dump function to atomatically render HTML 2011-01-18 15:02:51 -08:00
Misko Hevery
1d7b9d5626 support compilation in HTML widgets 2011-01-14 10:30:05 -08:00
Misko Hevery
347be5ae9a fixed select with ng:format
select (one/multiple) could not chose from a list of objects, since DOM requires string ids.
Solved by adding index formatter, which exposed incorrect handling of formatters in select
widgets.
2011-01-14 10:30:00 -08:00
Igor Minar
23875cb330 significant rewrite of the $location service
- don't update browser before and after eval instead
  - sync location properties before eval
  - sync location properties and update browser after eval
- added tests
- symplified the code
- removed $location.toString() because it was not idempotent and useless

This resolves the issue with issuing two $route.onHashChange calls
when the $location was updated with a hashPath that needs to be encoded
2011-01-13 16:58:35 -08:00
Igor Minar
b0be87f663 fix for angular.Object.equals to handle equals({},null) 2011-01-13 07:55:31 -08:00
Vojta Jina
aab3df7aea Fixed filter.date, so it parses format ending with non-replaced string
Closes #159
2011-01-10 10:37:37 -08:00
Igor Minar
0a6cf70deb Rename angular.foreach to angular.forEach to make the api consistent.
camelcase is used for other angular functions and forEach is also
used by EcmaScript standard.

- rename the internal as well as the external function name
- tweak the implementation of the function so that it doesn't
  clober it self when we extend the angular object with an
  object that has a forEach property equal to this forEach function

Closes #85
2011-01-10 10:26:55 -08:00
Igor Minar
0ad39dde4f fix onhashchange tests for IE 2011-01-10 10:24:12 -08:00
Misko Hevery
47c454a315 change to keydown from keyup; add delayed $updateView
- There was a perceived lag when typing do to the fact that we were
   listening on the keyup event instead of keydown. The issue with
   keydown is that we can not read the value of the input field. To
   solve this we schedule a defer call and perform the model update
   then.

 - To prevent calling $eval on root scope too many times as well as to
   prevent drowning the browser with too many updates we now call the
   $eval only after 25ms and any additional requests get ignored. The
   new update service is called $updateView
2011-01-07 14:39:46 -08:00
Igor Minar
16086aa37c $location service should utilize onhashchange events instead of polling 2011-01-07 14:39:41 -08:00
Igor Minar
b28dee7fd5 use toMatch in widgetSpec 2011-01-07 12:02:46 -08:00
Igor Minar
142a985f33 Revert "Issue #51: Update extensionMap()"
This reverts commit 00ca67e4be.

Now that we don't have published services, we don't need to worryi
about this any more and in fact this behavior is confusing because
to override a service that has dependencies with a services with
no dependencies one must specify $inject:[] or else the old
dependencies will be injected.

Conflicts:

	src/Angular.js
	test/AngularSpec.js
2011-01-07 12:02:45 -08:00
Misko Hevery
807d8c92b3 removed dissabled tests which are now outdated 2011-01-06 14:51:44 -08:00