Commit graph

3402 commits

Author SHA1 Message Date
Mark J. Titorenko
9bbd62f454 fix(ngMock.$interval): should use angular.isDefined
The newly introduced `$interval` mock service for ngMock calls `isDefined`
in the global namespace which fails when used within unit tests.

This change adds the missing `angular.` prefix to such `isDefined` calls.

Closes #4334
Closes #4353
2013-10-09 20:12:26 +01:00
Brian Ford
1366556ace test(filters): fix timezone-dependent test
Closes #4218
2013-10-09 10:18:51 -07:00
Marko Bonaci
fe65932404 docs(tutorial/step11): correct Jasmine Matcher link
Link http://pivotal.github.com/jasmine/jsdoc/symbols/jasmine.Matchers.html
is no longer valid.

Closes #4329
2013-10-09 11:30:22 +01:00
Brian Ford
f031430a6f docs(guide/animations): improve animations guide 2013-10-08 10:53:51 -07:00
Brian Ford
556e8eece6 docs(tutorial): fix style across tutorial steps 2013-10-08 10:49:33 -07:00
Brian Ford
d769b8b8f0 docs(jqLite): improve jqLite docs 2013-10-08 10:49:33 -07:00
Brian Ford
ad5256452b feat(tutorial): add step 12 of the phonecat tutorial 2013-10-08 10:49:33 -07:00
Vojta Jina
80d2c85e3c chore(travis): enable Firefox again
This updates karma-sauce-launcher plugin, which fixes the issue we were having (it uses the latest version of wd).

This reverts 1c18c93be1
2013-10-08 10:14:03 -07:00
Steven Sojka
9fd92cc3c9 fix(ngTouch): ngClick does not pass touchend event when jQuery is loaded
The trigger handler event in jqLite takes an event object as a second
parameter, but jQuery requires an array of parameters. This is causing
the touchend event to not come thtough in the click handler when jQuery
is loaded.
2013-10-08 09:14:33 -07:00
J Bruni
f7fc00841b docs(cookbook/adv_forms): simplify example
Pass the `$index` directly to the `removeContact` function, instead of
searching for it in an expensive forEach loop.

Closes #4320
2013-10-08 12:59:46 +01:00
Adam Kent
507d8021b1 fix(ngTouch): add $event to ng-swipe
Existing documentation implies that an Event object should be available
as `$event` on swipe directives, which previously was only working for
`ng-click`.

Closes #4071
Closes #4321
2013-10-08 12:55:16 +01:00
Marc Tamlyn
bed08c9c66 docs(angular.equals): fix simple typo
- JavasScript -> Javascript

Closes #4323
2013-10-08 12:32:20 +01:00
Pete Bacon Darwin
b56b21a898 fix(input): false is no longer an empty value by default
`checkboxInputType` and `ngList` directives need to have special logic for whether
they are empty or not.  Previously this had been hard coded into their
own directives or the `ngRequired` directive.  This made it difficult to handle
these special cases.

This change factors out the question of whether an input is empty into a method
`$isEmpty` on the `ngModelController`.  The `ngRequired` directive now uses this
method when testing for validity and directives, such as `checkbox` or `ngList`
can override it to apply logic specific to their needs.

Closes #3490, #3658, #2594
2013-10-07 16:47:51 -07:00
Julie
2b5ce84fca feat($interval): add a service wrapping setInterval
The $interval service simplifies creating and testing recurring tasks.
This service does not increment $browser's outstanding request count,
which means that scenario tests and Protractor tests will not timeout
when a site uses a polling function registered by $interval. Provides
a workaround for #2402.

For unit tests, repeated tasks can be controlled using ngMock$interval's
tick(), tickNext(), and tickAll() functions.
2013-10-07 13:45:40 -07:00
Pete Bacon Darwin
a80e96cea1 fix(ngScenario): remove redundant assignment
Closes #4315
2013-10-07 19:44:03 +01:00
Igor Minar
670cd9c165 revert: refactor($parse): only instantiate lex/parse once
This reverts commit 281feba4ca.

Since Lexer and Parser objects are stateful it is not safe
to reuse them for parsing of multiple expressions.

After recent refactoring into prototypical style, the instantiation
of these objects is so cheap that it's not a huge win to use
singletons here.
2013-10-07 11:10:24 -07:00
Peter Bacon Darwin
7a586e5c19 fix(*): protect calls to hasOwnProperty in public API
Objects received from outside AngularJS may have had their `hasOwnProperty`
method overridden with something else. In cases where we can do this without
incurring a performance penalty we call directly on Object.prototype.hasOwnProperty
to ensure that we use the correct method.

Also, we have some internal hash objects, where the keys for the map are provided
from outside AngularJS. In such cases we either prevent `hasOwnProperty` from
being used as a key or provide some other way of preventing our objects from
having their `hasOwnProperty` overridden.

BREAKING CHANGE: Inputs with name equal to "hasOwnProperty" are not allowed inside
form or ngForm directives.

Before, inputs whose name was "hasOwnProperty" were quietly ignored and not added
to the scope.  Now a badname exception is thrown.

Using "hasOwnProperty" for an input name would be very unusual and bad practice.
Either do not include such an input in a `form` or `ngForm` directive or change
the name of the input.

Closes #3331
2013-10-07 09:01:13 -07:00
Peter Bacon Darwin
fb99f54206 style(select): fix semicolons and vars 2013-10-07 08:45:25 -07:00
Peter Bacon Darwin
9af8f4e585 style(injectorSpec): add semicolons & test helpers 2013-10-07 08:45:25 -07:00
Peter Bacon Darwin
d3fce9e82c style(angularSpec): add missing semicolon 2013-10-07 08:45:25 -07:00
Dave Peticolas
4d6a7781d7 docs(ngModel): fix grammar and improve clarity
Closes #4291
2013-10-07 14:37:28 +01:00
Peter Bacon Darwin
281feba4ca refactor($parse): only instantiate lex/parse once
Closes #4286
2013-10-07 14:31:14 +01:00
Brian Ford
805efb4c47 docs(ngValue): add docs for ngValue directive
Closes #4267
2013-10-07 14:29:07 +01:00
pzajdel
28fe4464d8 docs(tutorial/step02): fix missing brace
Closes #4301
2013-10-06 22:26:33 +01:00
Pete Bacon Darwin
47f7bd706e fix(rootScope): make stopPropagation only stop its own event
All sibling event handlers residing on the same scope to were stopped
if one of them called stopPropagation.

Closes #4204
2013-10-05 22:45:43 +01:00
Michiel Staessen
9089468092 docs(a): change model.$save() into something less deceptive
Closes #4215
2013-10-05 21:56:37 +01:00
Dave Peticolas
78eead6775 docs(ngList): improve grammar and clarity 2013-10-05 21:49:16 +01:00
Tom Elovie Spruce
7645e05e4d docs(filter): add missing semi-colon
Closes #4273
2013-10-05 21:44:14 +01:00
Eric Large
55422b88d8 docs(tutorial/step_07): fix module name
Closes #4283
2013-10-05 21:03:19 +01:00
David Barker
e8a139c6d4 docs($resource): remove extra "to" from $resource docs
Closes #4287
2013-10-05 17:51:21 +01:00
Jen Bourey
8336b3a286 fix(ngResource): Remove request body from $delete
Prevent the  obj.$delete instance method from sending the resource as the request body.  This commit uses the existing hasBody boolean to only set httpConfig.data for methods which should have a request body.

Closes #4280
2013-10-04 16:50:08 -07:00
jankuca
49e06eace5 chore($parse): convert parser() and lex() to prototype-based code
This reduces memory consumption of parsed angular expressions and
speeds up parsing.

This JSPerf case demonstrates the performance boost:
http://jsperf.com/closure-vs-prototype-ngparser

Chrome: 1.5–2x boost
FF: slightly slower (I would love to know why)
IE: 4x boost

To be clear, this doesn't have any impact on runtime performance
of expressions as demostrated in this JSPerf:
http://jsperf.com/angular-parser-changes

Closes #3681
2013-10-04 14:15:56 -07:00
Matias Niemelä
948e8ca325 chore(docs): fix broken IE8 test due to sanitization bug 2013-10-04 13:43:11 -04:00
Vojta Jina
1c18c93be1 chore(travis): temporarily disable Firefox
I can't get it allocated on SauceLabs and so this is failing all the builds, making our Travis build useless.

I contacted folks from SL. Once we figure it out, I will revert this change.
2013-10-04 09:12:48 -07:00
Nicola Peduzzi
0ff86c3233 fix(routeProvider): parametrized routes do not match against locations that would not valorize each parameters. 2013-10-04 08:45:47 -07:00
Igor Minar
31f190d4d5 fix($compile): fix (reverse) directive postLink fn execution order
previously the compile/link fns executed in this order controlled via priority:

- CompilePriorityHigh, CompilePriorityMedium, CompilePriorityLow
- PreLinkPriorityHigh, PreLinkPriorityMedium, PreLinkPriorityLow
- link children
- PostLinkPriorityHigh, PostLinkPriorityMedium, PostLinkPriorityLow

This was changed to:

- CompilePriorityHigh, CompilePriorityMedium, CompilePriorityLow
- PreLinkPriorityHigh, PreLinkPriorityMedium, PreLinkPriorityLow
- link children
- PostLinkPriorityLow, PostLinkPriorityMedium , PostLinkPriorityHigh

Using this order the child transclusion directive that gets replaced
onto the current element get executed correctly (see issue #3558),
and more generally, the order of execution of post linking function
makes more sense. The incorrect order was an oversight that has
gone unnoticed for many suns and moons.

(FYI: postLink functions are the default linking functions)

BREAKING CHANGE: the order of postLink fn is now mirror opposite of
the order in which corresponding preLinking and compile functions
execute.

Very few directives in practice rely on order of postLinking function
(unlike on the order of compile functions), so in the rare case
of this change affecting an existing directive, it might be necessary
to convert it to a preLinking function or give it negative priority
(look at the diff of this commit to see how an internal attribute
interpolation directive was adjusted).

Closes #3558
2013-10-03 22:23:37 -07:00
Igor Minar
fe2145016c fix($compile): don't terminate compilation for regular transclusion directives
Previously we would stop the compilation for both regular and element
transclusion directives which was wrong. Only element transclusion directives
should be terminal.
2013-10-03 22:19:46 -07:00
gdennie
a27b4cf5fd docs(guide/directive): clarify use of binding to scopes
The use of 'angular' as sample text is confusing to the newbie in that they are forced
to confirm that the text 'angular' is not a keyword or otherwise referring to a system
component. This is changed to a more obvious sample text.

The most common form of `ngBind` is moved to the top of the list.

Closes #4237
2013-10-03 23:44:42 +01:00
mtaran-google
333e3375e0 docs(guide/directive): fix indentation in example code
Closes #4241
2013-10-03 23:40:00 +01:00
Joe Hanink
1691c4e9a3 docs(angular.bind): clarify that bind is partial application
The `angular.bind` function reflects the definition of "partial application", which
reduces a function's arity rather than transforming a function with n args into a
chain of n functions, each having a single arg.

curry : f(x,y,z) -> f(x)(y)(z)
partial application : f(x,y,z) -> f(x)(y,z)

Closes #4239
2013-10-03 23:37:09 +01:00
Simeon Willbanks
7fec4bae80 docs($sce): fix punctuation
Closes #4235
2013-10-03 23:20:58 +01:00
Dave Peticolas
2c00476bae docs(rootScope): improve grammar and clarity
Closes #4234
2013-10-03 23:14:55 +01:00
Pete Bacon Darwin
2e5680a4e3 docs(guide/$location): fix broken example demo
The demo of the hash-bang vs html5-mode deep links was broken since the introduction
of a check for previously bootstrapped elements. See this commit: 3ee744cc63

We fix this problem by applying a null for the injector value of the element of the
at the root of the sub-app.
It also turns out that it was not necessary, and if fact broke the demo, to replace
the $document service for the sub-app.  This was because the $compile service calls
`$document.createElement()`, which doesn't exist on a `div`.
Finally, the bootstrap CSS was limiting the width of the ngAddress bar input box,
which made it difficult to see the changing URLs.
2013-10-03 23:05:56 +01:00
Dave Peticolas
a005797afa docs(ngInclude): clarity, formatting
Closes #4222
2013-10-03 21:44:16 +01:00
Dave Peticolas
b5214aa20a docs(ngClass): clarify the description
Closes #4220
2013-10-03 21:29:59 +01:00
Freek Wielstra
171feb8fc6 docs(guide/$location): replace host.com addresses with example.com
The host.com links on this documentation page took you to an ad page of dubious content.
Now changed to example.com, in accordance with RFC 2606

Closes #4206
2013-10-03 21:10:47 +01:00
basarat
3a231d4cbe docs($compile): fix param description being displayed as code block
Closes #4187
2013-10-03 21:06:44 +01:00
Pete Bacon Darwin
0f7237d764 docs(tutorial): improve wording and consistency 2013-10-03 11:58:47 +01:00
James Dunn
575f63ac50 docs(tutorial): update examples to show best practices
Closes #4256, #4255, #4254, #4253, #4250, #4092
2013-10-03 10:19:19 +01:00
gdennie
d3fcacedd6 docs(select): clarify usage
The wording seemed confusing and these adjustments seem to capture the intent
with less turbulence.

Closes #4257
2013-10-03 10:06:02 +01:00