Commit graph

96 commits

Author SHA1 Message Date
Misko Hevery
acf095d178 fix(jqLite): have same expando format as jQuery 2012-05-17 10:36:45 -07:00
Misko Hevery
ec1c5dfaee fix(jqLite): .data()/.bind() memory leak
Since angular attaches scope/injector/controller
into DOM it should clean up after itself. No need
to complain about memory leaks, since they can
only happened on detached DOM. Detached DOM would
only be in tests, since in production the DOM
would be attached to render tree and removal
would automatically clear memory.
2012-05-14 21:56:22 -07:00
Igor Minar
a44d3dcd6a chore(testabilityPatch): print number of leaked references if any 2012-05-03 23:31:28 -07:00
Igor Minar
9cba23a588 chore(trace): add helper method trace
use it as trace('label') to dump the stack during debugging
2012-05-03 10:07:30 -07:00
Misko Hevery
8218c4b60b chore(Rakefile): get ready for modules 2012-03-28 11:16:36 -07:00
Igor Minar
f4d338d393 chore(*): refactor all ng: to ng- 2012-03-09 16:14:26 -08:00
Vojta Jina
4f797fe5f3 refactor(testabilityPatch): Change JSTD fail to more general throw
"fail" is a JSTD specific API, so it's not defined when testing without JSTD (eg SlimJim).
2012-03-05 10:41:51 -08:00
Misko Hevery
9ee2cdff44 refactor(directives): connect new compiler
- turn everything into a directive
2012-01-25 11:50:37 -08:00
Misko Hevery
8af4fde182 add($compile): add compiler v2.0 - not connected 2012-01-25 11:46:36 -08:00
Misko Hevery
1e258d11d0 feat(test): support it('should', pending); 2012-01-25 11:46:35 -08:00
Igor Minar
ed78f0d830 chore(log): generic test log service with custom toEquals matcher
- any test that needs a logger can just inject provideLog
- logger has susict api that makes tests more readable
- custom toEquals matcher allows for pretty expectations
2012-01-23 22:33:28 -08:00
Vojta Jina
c594f75b4c refactor: remove old JSTD assertions
So that we can run the tests even without JSTD :-D
2012-01-03 15:09:00 -08:00
Misko Hevery
e88dfb734a refactor(injector): $injector is no longer a function.
- $injector('abc') -> $injector.get('abc');
- $injector(fn) -> $injector.invoke(null, fn);
2011-11-14 20:31:19 -08:00
Vojta Jina
acbd7cdf32 style(docs): make jslint happy - fix some warnings 2011-11-14 20:31:19 -08:00
Misko Hevery
b09595a3c1 fix(doc) cleanup all api doc link warnings 2011-11-14 20:31:18 -08:00
Misko Hevery
f0fa5e6376 doc(AUTO, NG_MOCK): Documenting the AUTO and NG_MOCK module 2011-11-14 20:31:16 -08:00
Misko Hevery
a87f2fb9e4 refactor(mock): moved mocks into its own module 2011-11-14 20:31:14 -08:00
Misko Hevery
7c11531902 refactor(parser): turn parser into a service (keep compatibility hack) 2011-11-14 16:39:33 -08:00
Misko Hevery
bd04316a89 refactor(services): migrate angular.service -> module 2011-11-14 16:39:33 -08:00
Misko Hevery
ed36b9da3b refactor(injector): switch to injector 2.0 introduce modules 2011-11-14 16:39:32 -08:00
Misko Hevery
c925f8a657 new(injector): new injector v2.0
- not connected to keep the CL small
2011-11-14 16:39:32 -08:00
Misko Hevery
4c10d33eb4 refactor(api): cleaned up the externalization of angular API methods 2011-11-14 16:39:32 -08:00
Misko Hevery
d12df0d360 refactor(compiler) turn compiler into a service
BREAK
- remove angular.compile() since the compile method is now a service and needs to be injected
2011-11-14 16:39:32 -08:00
Misko Hevery
48697a2b86 refactor(injector): turn scope into a service
- turn scope into a $rootScope service.
- injector is now a starting point for creating angular application.
- added inject() method which wraps jasmine its/beforeEach/afterEach,
  and which allows configuration and injection of services.
- refactor tests to use inject() where possible

BREAK:
- removed angular.scope() method
2011-11-14 16:39:31 -08:00
Vojta Jina
2636105c5e feat(matchers): extract jasmine matchers into separate file for future reuse
Prefix all used functions with angular.* so that they can be used with compiled angular as well...
2011-10-31 18:22:21 -07:00
Misko Hevery
fd822bdaf9 chore(formating): clean code to be function() { 2011-10-11 11:01:46 -07:00
Misko Hevery
4f78fd692c feat(forms): new and improved forms 2011-10-11 11:01:45 -07:00
Igor Minar
084b83ffa9 test(matchers): add toBeOneOf matcher 2011-09-27 21:48:47 +02:00
Igor Minar
2170c06924 fix(specs): fix jQuery to jqLite binding on IE8
It appears that this whole time all IE8 unit tests ran only with jqLite. Due to a weird bug in IE[1], we never overwrote jqLite implementation with jQuery, so the tests ran with our jqLite instead.

This affected only IE8 (and likely older) and only in unit testing mode. angular.js - the built artifact binds to jQuery just find.

[1] https://plus.google.com/104744871076396904202/posts/Kqjuj6RSbbT
2011-09-16 02:44:33 +02:00
Vojta Jina
b99b0a8072 feat(test): toHaveBeenCalledOnce jasmine matcher 2011-08-18 17:41:23 +02:00
Misko Hevery
8f0dcbab80 feat(scope): new and improved scope implementation
- Speed improvements (about 4x on flush phase)
- Memory improvements (uses no function closures)
- Break $eval into $apply, $dispatch, $flush
- Introduced $watch and $observe

Breaks angular.equals() use === instead of ==
Breaks angular.scope() does not take parent as first argument
Breaks scope.$watch() takes scope as first argument
Breaks scope.$set(), scope.$get are removed
Breaks scope.$config is removed
Breaks $route.onChange callback has not "this" bounded
2011-08-02 01:00:03 +02:00
Igor Minar
fe5240732d feat(strict mode): adding strict mode flag to all js files
the flag must be in all src and test files so that we get the benefit of
running in the strict mode even in jstd

the following script was used to modify all files:

for file in `find src test -name "*.js"`; do
  echo -e "'use strict';\n" > temp.txt
  cat $file >> temp.txt
  mv temp.txt $file
done
2011-07-18 12:12:55 -07:00
Igor Minar
4c6d26a38f fix(strict mode): fix all issues discovered by strict mode and unit/e2e tests 2011-07-18 12:12:54 -07:00
Di Peng
7a3fdda965 feat(jqlite): added show(),hide() and eq() methods to jqlite
- add those three methods to jqlite
2011-07-17 22:19:08 -07:00
Igor Minar
6aee2938a7 fix:testabilityPatch: remove annotate since it's not public 2011-06-27 16:46:29 -07:00
Vojta Jina
d0edc11704 Fix failing unit tests in IE7 (Binder, select widget)
The fix does not change any production code, we only need to ignore couple of attributes that IE7 should not display:
* value attribute for LI
* selected attribut for SELECT

Simplified condition in compiler test, this should have been part of f9f0905f4a
2011-06-17 22:48:22 +02:00
Misko Hevery
af285dd370 Added ng:options directive
Closes #301
2011-06-08 15:21:33 -07:00
Misko Hevery
8cad231bd2 Refactor injector to have invoke method for speed reasons 2011-06-08 15:21:31 -07:00
Misko Hevery
73e3f4c10c better error reporting for exceptions 2011-06-08 13:49:11 -07:00
Vojta Jina
aa64d37a23 Fix unit test in IE7 2011-06-02 08:55:10 -07:00
Igor Minar
9462b556a3 fix build for IE9
all unit tests now pass under IE9
2011-04-09 00:16:44 -07:00
Misko Hevery
00cc9eb32a rewrite of JQuery lite implementation, which now better supports selected sets 2011-02-16 08:59:42 -05:00
Misko Hevery
23b255a8b7 remove $init on scope from applying compilation template
Closes #40
2011-02-16 00:49:15 -05:00
Misko Hevery
a004d487c4 allow jquery to be declared after angular in the script loading order 2011-02-16 00:48:22 -05:00
Misko Hevery
46d690ff01 smarter normalization of value on option, and htmlParser fixes 2011-02-04 13:44:22 -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
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
Misko Hevery
459a01e582 improved dump function to atomatically render HTML 2011-01-18 15:02:51 -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
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