Commit graph

3422 commits

Author SHA1 Message Date
Felix
e86aaa992f docs(guide/controller): use .controller syntax
Use the recommended `module.controller` syntax rather than global
functions to define controllers in the examples.
2013-10-11 11:38:13 +01:00
Matias Niemelä
b1e604e38c fix($animate): perform internal caching on getComputedStyle to boost the performance of CSS3 transitions/animations
Closes #4011
Closes #4124
2013-10-10 17:35:36 -07:00
Matias Niemelä
1438f1b626 chore(ngdocs): improve the side search animation effects 2013-10-10 17:35:36 -07:00
Matias Niemelä
cc5846073e fix($animate): ensure structural animations skip all child animations even if no animation is present during compile
Closes #3215
2013-10-10 17:35:36 -07:00
Matias Niemelä
23c698821f refactor($animate): queue all successive animations to use only one reflow 2013-10-10 17:35:36 -07:00
Matias Niemelä
3f31a7c769 fix($animate): cancel any ongoing child animations during move and leave animations 2013-10-10 17:35:36 -07:00
Matias Niemelä
079dd93991 fix($animate): ensure elapsedTime always considers delay values 2013-10-10 17:35:36 -07:00
Matias Niemelä
7ef9dbb3df refactor($animate): avoid checking for transition/animation support during each animation 2013-10-10 17:35:36 -07:00
Brian Ford
e819d21fa0 docs(ngInit): add note on best practices 2013-10-10 13:53:50 -07:00
Pete Bacon Darwin
07272608d8 fix(modules): stop leaking global variables in tests
The routeUtils.js file was declaring a number of functions that were
leaking into other modules such as ngMocks causing tests to pass
incorrectly.

Closes #4360
2013-10-10 11:58:15 -07:00
Jeff Cross
b019a48bb1 refactor(location): $location now uses urlUtils, not RegEx
The location service, and other portions of the application,
were relying on a complicated regular expression to get parts of a URL.
But there is already a private urlUtils provider,
which relies on HTMLAnchorElement to provide this information,
and is suitable for most cases.

In order to make urlUtils more accessible in the absence of DI,
its methods were converted to standalone functions available globally.

The urlUtils.resolve method was renamed urlResolve,
and was refactored to only take 1 argument, url,
and not the 2nd "parse" boolean.
The method now always returns a parsed url.
All places in code which previously wanted a string instead of a parsed
url can now get the value from the href property of the returned object.

Tests were also added to ensure IPv6 addresses were handled correctly.

Closes #3533
Closes #2950
Closes #3249
2013-10-10 11:41:07 -07:00
Pete Bacon Darwin
74ef7f14a4 docs($provide): improve docs and examples further
Improve the "tracking" service example by adding a configuration option.
Get better formatting of the generated code samples using <pre> tags.
Move the detailed explanations into each function's documentation block.
Improve the overview and list the constituent functions by significance.

Closes #4302
2013-10-10 16:46:59 +01:00
Tim Ruffles
3eb2fbf745 docs($provide): improve examples and explanations
$provide's example seems awkward. Replace with more real-world example,
using an injected service, where the service defined has a good reason to
be a singleton.

There's quite a lot of confusion around $provide:
http://stackoverflow.com/search?q=angularjs+service+vs+factory
Tests for example at: http://jsbin.com/EMabAv/1/edit?js,output
2013-10-10 16:43:12 +01:00
Ilia Choly
cbd69db292 chore(gitignore): ignore *.swp files from vim
Closes #4311
2013-10-10 09:16:11 +01:00
jankuca
9efa46ae64 feat(ngRepeat): use block separator comments
Issue: multi-elements ng-repeat (ng-repeat-start, ng-repeat-end) can contain elements with a trancluding directive. This directive changes content of the row (template) and ng-repeat does not work correctly (when removing/moving rows), because ng-repeat works with the original template (elements).

This changes ng-repeat behavior to traverse the DOM to find current elements everytime we are moving/removing rows (if the template has multiple elements).

Closes #3104
2013-10-09 15:19:10 -07:00
Vojta Jina
64fd2c421e fix(jqLite): ignore class methods on comment elements
Since c785267e jqLite uses setAttribute (rather than className property) in order to change classes. Some elements (eg. Comment) do not have this method which blows up.

jQuery silently ignores these method calls (because it uses className), so to get the same behavior as jQuery, we check for setAttribute method first.
2013-10-09 15:19:10 -07:00
Igor Minar
b6a37d112b revert: fix($parse): handle promises returned from parsed function calls
This reverts commit 3a65822023.

The change cased regressions in third party components that require
promises from getter functions not to be unwrapped.

Since we have deprecated the promise unwrapping support in $parse it
doesn't make much sense to fix this issue and deal with regressions in
third party code.

Closes #4158
2013-10-09 15:15:43 -07:00
Igor Minar
5dc35b527b fix($parse): deprecate promise unwrapping and make it an opt-in
This commit disables promise unwrapping and adds
$parseProvider.unwrapPromises() getter/setter api that allows developers
to turn the feature back on if needed. Promise unwrapping support will
be removed from Angular in the future and this setting only allows for
enabling it during transitional period.

If the unwrapping is enabled, Angular will log a warning about each
expression that unwraps a promise (to reduce the noise, each expression
is logged only onces). To disable this logging use
`$parseProvider.logPromiseWarnings(false)`.

Previously promises found anywhere in the expression during expression
evaluation would evaluate to undefined while unresolved and to the
fulfillment value if fulfilled.

This is a feature that didn't prove to be wildly useful or popular,
primarily because of the dichotomy between data access in templates
(accessed as raw values) and controller code (accessed as promises).

In most code we ended up resolving promises manually in controllers
or automatically via routing and unifying the model access in this way.

Other downsides of automatic promise unwrapping:

- when building components it's often desirable to receive the
  raw promises
- adds complexity and slows down expression evaluation
- makes expression code pre-generation unattractive due to the
  amount of code that needs to be generated
- makes IDE auto-completion and tool support hard
- adds too much magic

BREAKING CHANGE: $parse and templates in general will no longer
automatically unwrap promises. This feature has been deprecated and
if absolutely needed, it can be reenabled during transitional period
via `$parseProvider.unwrapPromises(true)` api.

Closes #4158
Closes #4270
2013-10-09 15:15:43 -07:00
Ben Lesh
2fe5a2def0 docs($anchorScroll): fix example controller and style
Changed controller name in example html to ScrollCtrl to match name in example js.
Add styling to example html so scrollable area is not obtrusive to documentation page design.

Closes #3898
2013-10-09 21:14:57 +01:00
Henry Hazan
5fc6eb0b5d docs($log): explain how to configure debug logging
Closes #4348
2013-10-09 21:10:38 +01:00
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