Commit graph

2647 commits

Author SHA1 Message Date
Igor Minar
202087f03d style($compile): clarify argument name 2013-05-08 07:57:33 -07:00
R. Merkert
6d0b325f7f fix(angular): do not copy $$hashKey in copy/extend functions.
Copying the $$hashKey as part of copy/extend operations makes little
sense since hashkey is used primarily as an object id, especially in
the context of the ngRepeat directive. This change maintains the
existing $$hashKey of an object that is being copied into (likewise for
extend).
It is not uncommon to take an item in a collection, copy it,
and then append it to the collection. By copying the $$hashKey, this
leads to duplicate object errors with the current ngRepeat.

Closes #1875
2013-05-08 12:45:32 +01:00
Illniyar
cf4729faa3 feat($cookieStore): $cookieStore.get now parses blank string as blank string
closes #1918
2013-05-08 10:04:07 +01:00
Kevin Wells
4f2e360685 fix(date): correctly format dates with more than 3 sub-second digits
This date {{2003-09-10T13:02:03.123456Z | date: yyyy-mm-dd ss} is now
treated as having 123.45ms. Previously it had 123456ms so 123 seconds
were added to the formatted date.
Use local date in unit tests so they work in any time zone
2013-05-07 22:59:46 +01:00
Chad Smith
4622af3f07 fix(select): ensure empty option is not lost in IE9
Fix a check inside render for select elements with ngOptions, which
compares the selected property of an element with it's desired state.
Ensure the placeholder, if available, is explicitly selected if the model
value can not be found in the option list.
Without these fixes it's up to the browser implementation to decide which
option to choose. In most browsers, this has the effect of displaying the
first item in the list. In IE9 however, this causes the select to display
nothing.

Closes #2150, #1826
2013-05-07 21:27:42 +01:00
Pete Bacon Darwin
f046f6f73c fix(dateFilter): correctly format ISODates on Android<=2.1
In older Android browsers, `undefined` does not act like `0` in some
arithmetic operations. This leads to dates being formatted with `NaN`
strings in the dateFilter because the implementation of the `dateGetter`
function allows offset to be an optional parameter.
The fix is to convert offset to 0 if it is undefined.

Closes #2277, #2275
2013-05-07 11:43:25 +01:00
Hamish Macpherson
52c1498e25 doc(input): fix small typo in code example 2013-05-07 09:48:40 +01:00
Misko Hevery
2c69a6735e fix($location): prevent navigation when event isDefaultPrevented 2013-05-06 21:52:53 -07:00
Misko Hevery
c575a56fc5 docs(injector): add docs for $injector.has 2013-05-06 21:52:53 -07:00
Matthieu Larcher
af0eaa3047 feat(ngInclude): $includeContentRequested event
Adding a $includeContentRequested event in order to better keep track of
how many includes are sent and be able to compare it with how many have
finished.
2013-05-03 19:55:47 +01:00
Misko Hevery
a348e90aa1 fix($location): compare against actual instead of current URL 2013-05-02 18:22:03 -04:00
Misko Hevery
4bd7bedf48 fix($location): prevent navigation if already on the URL 2013-05-02 15:22:17 -04:00
Misko Hevery
fd21c7502f fix(ngAnamite): eval ng-animate expression on each animation 2013-05-02 15:22:16 -04:00
Misko Hevery
80341cb9ba feat(injector): add has method for querying
Closes #2556
2013-05-02 15:22:16 -04:00
Misko Hevery
9956baedd7 fix(ngView): accidentally compiling leaving content
closes: #2304
2013-05-02 15:22:16 -04:00
Gonzalo Ruiz de Villa
1d8e11ddfb fix(ngRepeat): correctly iterate over array-like objects
Check if the object is array-like to iterate over it like it's done with arrays.

Closes #2546
2013-05-02 15:12:37 +01:00
Gonzalo Ruiz de Villa
6452707d40 fix($rootScope) ensure $watchCollection correctly handles arrayLike objects 2013-05-02 15:12:37 +01:00
quazzie
dc9a580617 fix($location): back-button should fire $locationChangeStart
Before $locationChangeStart event is not broadcast when pressing the back-button on the browser.

Closes #2109
2013-05-01 14:42:10 +01:00
Pete Bacon Darwin
660605bdb8 test(ngAnimate): also provide W3C transition property to work on IE10
Closes: #2492
2013-05-01 13:57:44 +01:00
Siddique Hameed
89c0b5d096 docs(injector): fix typo
Closes: #2551
2013-05-01 13:14:54 +01:00
Braden Shepherdson
52a55ec618 feat(ngTap): Add a CSS class while the element is held down. 2013-04-30 16:56:24 -07:00
Vojta Jina
e295eeefaa test(controller): instantiate controller defined on window
Just adding a missing spec.
2013-04-30 14:38:14 -07:00
Vojta Jina
de2cdb0658 fix(ngController): allow dots in a controller name
The issue was introduced in cd38cbf975
2013-04-30 14:38:14 -07:00
David Bennett
cda7b71146 feat($httpBackend): add timeout support for JSONP requests
Documentation implies that timeout works for all requests, though it
only works with XHR. To implement:
- Change $httpBackend to set a timeout for JSONP requests which will
immediately resolve the request when fired.
- Cancel the timeout when requests are completed.
2013-04-30 20:42:34 +01:00
Chris Nicola
fc25a443f8 docs(guide:directive): add directive controller usage
Specifically adding a directive controller to the example definition
and how to use declare injectables to avoid minification errors.
2013-04-30 10:47:14 +01:00
Robin Böhm
d6984db4d5 style($injector): add a comment to explain the distinction with isArray 2013-04-30 10:39:33 +01:00
Eugene Wolfson
ef7ba7b212 docs($provide): fix parentheses in example 2013-04-30 10:16:24 +01:00
Matias Niemelä
b3a62b2e19 feat(ngdocs): support for HTML table generation from docs code 2013-04-29 17:43:14 -04:00
Misko Hevery
400f9360bb fix(ngController): change controllerAlias to controllerAs. 2013-04-29 14:28:54 -04:00
Lucas Galfasó
7812ae75d5 fix(parse): Fix context access and double function call
Fix a context duplication and invocation to a previous context when
doing an access modifier function on the result of a function
Currently, when doing `foo().bar()`, `foo` is called twice, the first
time to get the context and the second one for `bar` to get the
underlying object. Then the call to `bar` is called using the second
instance as self
This is equivalent to doing:
```
var instance1 = foo();
var instance2 = foo();
instance2.bar.apply(instance1);
```

Closes #2496
2013-04-29 19:16:21 +01:00
Lucas Galfasó
da8c320bde test(parse): Test for the parsing not invoking twice to get self
New tests to not call twice a function to get self
2013-04-29 19:12:19 +01:00
gockxml
06f2b2a8cf fix(jqLite): correct implementation of mouseenter/mouseleave event
Implement mouseenter/mouseleave event referring to
http://www.quirksmode.org/js/events_mouse.html#link8 and jQuery source
code(not dependent on jQuery).
The old implementation is wrong. When moving mouse from a parent element
into a child element, it would trigger mouseleave event, which should not.
And the old test about mouseenter/mouseleave is wrong too. It just
triggers mouseover and mouseout events, cannot describe the process of mouse
moving from one element to another element, which is important for
mouseenter/mouseleave.

Closes #2131, #1811
2013-04-29 18:26:32 +01:00
Oren Avissar
0985a37376 test(browser/compile): fix calls to Jasmine fail()
The fail() function in Jasmine expects an Error object parameter.
Also, there is no global alias for fail() so it must be accessed using
`this.fail(new Error())`.
2013-04-29 16:56:35 +01:00
Robin Böhm
cb62a57d43 refact(ngClass): improve performance through bitwise operations
Change modulo % 2 operations to bitwise & 1
Read about this in Nicholas C. Zakas book "High Performance JavaScript"(ISBN: 978-0-596-80279-0)
Use the Fast Parts --> Bitwise Operators --> Page 156++
Proven at http://jsperf.com/modulo-vs-bitwise/11
2013-04-29 10:19:07 +01:00
Jamie R. Rytlewski
61c0adedc3 docs($q): fix typo 2013-04-28 18:44:07 +01:00
Anton
8a59d8668c docs(contribute): add Java as dependency
Current build process leverages closure jar for javascript minification.
If Java is not installed and included in the PATH the build will fail.
2013-04-28 18:37:24 +01:00
Andreas Pelme
32719c7976 docs(route): fix typo in route documentation 2013-04-26 13:16:19 +01:00
Pete Bacon Darwin
77ff108555 fix(location): correctly rewrite Html5 urls 2013-04-25 19:08:41 +01:00
Pete Bacon Darwin
0fbf584643 test(location): should not rewrite Html5 deep urls 2013-04-25 19:08:41 +01:00
Paulo Ávila
5a8ae94f9c docs(filter): improve syntax for usage in templates 2013-04-24 21:55:58 +01:00
Laurent Cozic
6605adf6d9 feat($q): add $q.always() method
Add $q.always(callback) method that is always called whether the promise is successful or fails; includes unit tests and updates
documentation.
2013-04-24 20:56:18 +01:00
Jeff Pickelman
b1157aafd7 docs(di): fix typos and grammar 2013-04-24 20:52:25 +02:00
Timothy Ahong
2d5297e665 docs(guide:unit-testing): add an example unit test for directives 2013-04-23 14:00:14 +01:00
Misko Hevery
cd38cbf975 feat(controller): support as instance syntax
Support ng-controller="MyController as my" syntax
which publishes the controller instance to the
current scope.

Also supports exporting a controller defined with route:
````javascript
angular.module('routes', [], function($routeProvider) {
  $routeProvider.when('/home', {controller: 'Ctrl as home', templateUrl: '...'});
});
````
2013-04-22 23:28:41 -07:00
Misko Hevery
021bdf3922 fix($animator): remove dependency on window.setTimeout. 2013-04-22 23:13:26 -07:00
Pete Bacon Darwin
de296f1b52 docs(compiler): don't drag selected content
In the example with draggable, the mouseDown handler needs to start with an event.preventDefault(). Otherwise the following bug occurs:
1) Select the text of the draggable span by clicking outside the span and dragging the mouse to the left or right through the span. Release the mouse button.
2) Now click on the span's inner text, and start to Drag it. The browser's default functionality that drags highlighted text so that it can be pasted into something else (say a document in a text editor) is invoked.
3) Release the mouse button. Now suddenly, you'll be dragging the span. But you won't be able to place it down on the page. It'll just follow the mouse around until the page is refreshed.

Closes: #2465
2013-04-22 13:38:18 +01:00
Keir Mierle
8c75b5f55a docs(compiler): fix variable scope in drag sample
Note that without this fix, if you add a second draggable element, the
two instances clobber each other since there is only one set of
startx/starty/x/y variables.
Here is an example: http://plnkr.co/edit/aGrLXcIo2SuaePuAdfmQ?p=preview.
On the surface it looks like it would be fine because you only have one
mouse but in practice the start position jumps when you start dragging.
Here it is fixed: http://plnkr.co/edit/VuvPasuumtCeiVRisYKQ?p=preview
2013-04-22 12:52:08 +01:00
Keir Mierle
2d66ccd593 docs(forms): fix formatting 2013-04-22 12:38:26 +01:00
Ron Yang
af9c20c07d docs(forms): fix typo 2013-04-22 12:34:38 +01:00
Paulo Ávila
2c34596b32 docs(guide): minor grammatical change 2013-04-21 19:53:52 +02:00