Commit graph

748 commits

Author SHA1 Message Date
Vojta Jina
dbffbefb7c refactor($controller): Add $controller service for instantiating controllers
So that we can allow user to override this service and use BC hack:
https://gist.github.com/1649788
2012-01-23 13:11:12 -08:00
Vojta Jina
0196411dbe refactor(scope.$watch): rearrange arguments passed into watcher (newValue, oldValue, scope)
As scopes are injected into controllers now, you have the reference anyway, so having scope as first argument makes no sense…

Breaks $watcher gets arguments in different order (newValue, oldValue, scope)
2012-01-23 11:11:27 -08:00
Vojta Jina
992c790f07 refactor(scope): separate controller from scope
Controller is standalone object, created using "new" operator, not messed up with scope anymore.
Instead, related scope is injected as $scope.

See design proposal: https://docs.google.com/document/pub?id=1SsgVj17ec6tnZEX3ugsvg0rVVR11wTso5Md-RdEmC0k

Closes #321
Closes #425

Breaks controller methods are not exported to scope automatically
Breaks Scope#$new() does not take controller as argument anymore
2012-01-23 11:05:36 -08:00
Igor Minar
b587091b6e feat(jqLite): added injector() helper method 2012-01-16 02:17:27 -08:00
Vojta Jina
c49b8a2db5 fix($location): do not $digest if browser's url change fired within $apply/$digest
Chrome (probably other browsers as well) fires 'hashchange' event synchronously, so if you change raw location from within $apply/$digest, we don't want to $apply twice. (It would throw an exception)
2012-01-14 11:23:12 -08:00
Misko Hevery
5cdfe45aa3 feat(module): add runtime block 2012-01-13 14:28:43 -08:00
Igor Minar
16a40c626f style(*): small fixes 2012-01-13 14:28:21 -08:00
Igor Minar
b7f4d8c3c3 fix($http): anonnymous response interceptors should be treated as factories 2012-01-13 14:28:20 -08:00
Igor Minar
46691c2721 fix($http): remove support for PATCH + better whenXXX, expectXXX api
- there are too many unknowns about PATCH, so I'm dropping its support until we know that this is actually useful
- expectGET, expectHEAD and expectJSON (and the same for whenXXX) should not require response data to be specified
2012-01-13 13:53:07 -08:00
Vojta Jina
15fd735793 refactor($autoScroll): rename to $anchorScroll and allow disabling auto scrolling (links)
Now, that we have autoscroll attribute on ng:include, there is no reason to disable the service completely, so $anchorScrollProvider.disableAutoScrolling() means it won't be scrolling when $location.hash() changes.

And then, it's not $autoScroll at all, it actually scrolls to anchor when it's called, so I renamed
it to $anchorScroll.
2012-01-13 01:07:12 -08:00
Vojta Jina
985d3d7558 refactor($autoScroll): rename method in test + use $apply instead of $digest 2012-01-13 01:05:24 -08:00
Vojta Jina
249c89c091 fix($autoScroll): scroll even if $location is in html5 mode
+ use autoscroll in docs (ng:include)
2012-01-13 01:01:26 -08:00
Misko Hevery
d648d709f3 refactor(module): strict separation between module-config / app-runtime 2012-01-12 13:40:07 -08:00
Vojta Jina
28114de8dc refactor(mock.$httpBackend): split (e2e/unit testing version of $httpBackend mock) 2012-01-11 22:11:01 -08:00
Vojta Jina
c6ea1be053 fix(mock.$httpBackend): resetExpectations should not create new array 2012-01-11 11:48:03 -08:00
Misko Hevery
5143e7bf06 feat(module): new module loader 2012-01-10 22:27:00 -08:00
Igor Minar
614fd3d55a fix(ng:repeat): support repeating over array with null
typeof null == 'object', but it doesn't behave like an object
because its properties can't be dereferenced, so we need
to special-case it.

Closes #702
2012-01-10 22:21:53 -08:00
Igor Minar
7146f70636 fix($httpBackend): fix for jsonp requests 2012-01-09 14:38:32 -08:00
Igor Minar
67338ce061 feat($http): turn mock backend into a decorator + e2e testing support
- provider -> decorator
- autoflush + passThrough mode
- fix noop -> angular.noop
2012-01-09 13:17:48 -08:00
Igor Minar
23f8da7cbb feat($http): expose req/resp headers to transform fns 2012-01-09 13:17:48 -08:00
Igor Minar
b911e303ec feat($httpBackend): add expect/when shortcut methods 2012-01-09 13:17:48 -08:00
Igor Minar
a13b5ed3bc fix($http): fix and cleanup $http and friends
$http:
- use promises internally
- get rid of XhrFuture that was previously used internally
- get rid of $browser.defer calls for async stuff (serving from cache),
  promises will take care of asynchronicity
- fix transformation bugs (when caching requested + multiple request
  pending + error is returned)
- get rid of native header parsing and instead just lazily parse the
  header string

$httpBackend:
- don't return raw/mock XMLHttpRequest object (we don't use it for
  anything anymore)
- call the callback with response headers string

mock $httpBackend:
- unify response api for expect and when
- call the callback with response headers string
- changed the expect/when failure error message so that EXPECTED and GOT
  values are aligned

Conflicts:

	src/service/http.js
	test/service/compilerSpec.js
	test/service/httpSpec.js
2012-01-09 13:17:48 -08:00
Igor Minar
63cca9afbc feat(browser.defer): flush should throw exception when queue is empty 2012-01-09 13:17:48 -08:00
Vojta Jina
5c19766063 feat(ng:include): enable/disable scrolling through autoscroll attribute 2012-01-07 00:18:22 -08:00
Dhruv Manek
08029c7b72 fix(angular.copy): throw Error if source and destination are identical
Closes #693
2012-01-06 12:19:39 -08:00
Igor Minar
0bf611087b feat(scope): throw exception when recursive $apply 2012-01-06 12:19:39 -08:00
Igor Minar
acb4338b70 style(widgetsSpec): ws, unused variables, etc 2012-01-06 12:19:39 -08:00
Igor Minar
cd9a7b9608 fix(ng:repeat): support repeating over array with null
typeof null == 'object', but it doesn't behave like an object
because its properties can't be dereferenced, so we need
to special-case it.

Closes #702
2012-01-06 12:19:39 -08:00
Igor Minar
9632f5c1c7 style(q): rename src/Deferred.js to src/service/q.js 2012-01-03 17:48:09 -08:00
Vojta Jina
6f91ffeb91 style: prefer single quotes + some whitespaces 2012-01-03 15:09:00 -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
bartes
0c534644bc fix(input): bind inputs to the 'input' event
The input event is fired on all non-ie browsers whenever the contents of an input
field changes. This means that we now support cut&paste via mouse which
was previously unsupported.

IE8 and older don't support this events and IE9 has a problematic
support for it, so we can't rely solely on this event and drop keydown
and change events.
2011-12-07 13:07:20 -08:00
Igor Minar
c28662d28d fix(filter): remove the $ prefix from filter service ids 2011-12-07 13:07:19 -08:00
Igor Minar
b97c6e5f74 style(scopeSpec): clean up scopeSpec.js 2011-12-07 09:41:09 -08:00
Igor Minar
4e3c05b99e feat(injector): add $provide.decorator 2011-12-07 09:41:08 -08:00
Igor Minar
5e4d59adf0 style(injector): cleanup of InjectorSpec.js 2011-12-07 09:41:07 -08:00
Igor Minar
fd38655e6c fix(): use angular.callbacks namespace for jsonp callbacks
Previously we used to put callbacks on the window object, but that
causes problems on IE8 where it is not possible to delete properties
from the window object
2011-12-07 07:54:09 -08:00
Vojta Jina
b9001e9147 fix(route): $destroy scope after update and reload
When we update route (changing only search param, no route reload) and then reload (change to different
route), it did not $destroy last scope.
2011-12-06 13:35:05 -08:00
Vojta Jina
c9f2b1eec5 feat(form): do not prevent submission if action attribute present 2011-12-06 13:07:26 -08:00
Igor Minar
163e05ed36 feat($http): allow interceptors to be services 2011-12-05 23:53:26 -08:00
Igor Minar
bb2e7488fa fix($httpBackend mock): getResponseHeader should be case insensitive 2011-12-01 18:21:45 -05:00
Igor Minar
44b2f44f93 fix($resource): forwardport exposing headers from 0.9.19 2011-12-01 16:20:08 -05:00
Igor Minar
1d14760c6d fix(ng:include): prevent race conditions by ignoring stale http callbacks
This fix is similar to what I've done in ng:view, if a new template has been requested before the
callback for the previous template returned, ignore it. Otherwise weird race conditions happen
and users might end up getting the content for the previous include rendered instead of the most
recent one.
2011-11-30 14:49:36 -05:00
Igor Minar
f43c226c67 fix(copy,equals): prevent browser crashes with Scope or Window
Scope and Window instances are special and when copied can crash browser. For this reason
it makes sense to compare them only by identity.
2011-11-30 14:49:36 -05:00
Misko Hevery
0e1fa2aefe feat($interpolate): string interpolation function 2011-11-30 14:49:36 -05:00
Igor Minar
b00da987a9 scope($digest): add new&old val to the infinite $digest log 2011-11-30 14:49:35 -05:00
Igor Minar
188bdf7768 feat($http): add response interceptors 2011-11-30 14:49:35 -05:00
Igor Minar
dbd880cc0a feat($http): add promise support
quite messy, some tests are missing, contains an experimental jasmine DI support)
2011-11-30 14:49:35 -05:00
Igor Minar
78b6e8a446 feat($parse): add support for transparent evaluation of Promises
Parser now builds expressions that can detect promises and transparently
evaluate them to undefined or the promise value.

If promiseA is resolved with value 'A', then {{promiseA}} evals to 'A';
If promiseA is unresolved, then {{promiseA}} evals to undefined;

Following invocations are supported:

- {{promise}}
- {{promise.futureProp}}
- {{[promise][0]}}
- {{object.promise}}
- {{object[promise]}}
- {{array[promise]}}
- {{fn(promise)}}
- combinations of the above
2011-11-30 14:49:35 -05:00
Igor Minar
1cdfa3b960 feat(deferreds/promises): Q-like deferred/promise implementation with a ton of specs 2011-11-30 14:49:03 -05:00