Commit graph

1937 commits

Author SHA1 Message Date
James Daily
ae70ec7946 docs(booleanAttrs): improve parameter docs for boolean attributes
Closes #3724
2013-09-05 13:16:40 +01:00
Pete Bacon Darwin
327a78604a docs(angular.bootstrap): clarify modules parameter
It was not clear what you could pass to specify modules to load in the
`module` parameter of this function. The `modules` parameter takes an
array.

The main case is to provide a String, which is the name of a "predefined"
angular module.
The side cases are to provide a Function (or an annotated function in the
form of an Array), which will be invoked by the injector as a run block.

It is not possible to "define" new modules via this parameter.

Closes #3692
2013-09-05 12:18:56 +01:00
Pete Bacon Darwin
21b1d22563 docs(): parameter for html5Mode is boolean 2013-09-05 10:01:50 +01:00
Ben Lesh
7ed5599a4b docs($anchorScroll): provide an example of basic usage.
Per a request made by Peter Bacon Darwin here:  http://www.benlesh.com/2013/02/angular-js-scrolling-to-element-by-id.html?showComment=1370941217879#c8718313084813008967
2013-09-05 08:32:52 +01:00
Matias Niemelä
40c0220c47 fix(ngView): ensure ngClass works with together with ngView's transclusion behavior
Closes: #3727
2013-09-03 17:06:49 -07:00
Matias Niemelä
36ad40b18c fix(ngAnimate): ensure that ngClass is always compiled before enter, leave and move animations
Closes #3727
Closes #3603
2013-09-03 17:06:49 -07:00
Matias Niemelä
4e15c4fb47 chore($rootScope): provide support to execute a function after the digest cycle is complete 2013-09-03 17:06:49 -07:00
Matias Niemelä
4382df03fa fix(ngAnimate): cut down on extra $timeout calls 2013-09-03 17:06:49 -07:00
Merrick Christensen
f737c97df0 feat(ngMock): allow passing an object literal as shorthand to module 2013-09-03 14:22:12 -07:00
jankuca
8e48c4ff6a fix($http): allow empty responses to be cached
Closes #3809
2013-09-02 11:47:51 +02:00
Chirayu Krishnappa
427ee93f11 fix(core): parse IE11 UA string correctly
It's great that IE11 wants to be compatible enough that it doesn't want
to be special cased and treated differently.

However, as long as one has to have a different code path for IE than
for the other supported browsers, we still need to detect and special
case it.  For instance, our URL parsing code still needs the same
workaround the we used for IE10.  We still see the same Access denied /
TypeError exceptions when setting certain values.  FYI, Angular doesn't
generally blindly test for IE – we also check the version number.

Thanks to modern.ie for the free IE11 test VM.

Closes #3682
2013-08-29 16:07:49 -07:00
Chirayu Krishnappa
068d8615d2 perf(ngBindHtml): watch the original value and sanitize later 2013-08-29 12:47:51 -07:00
Adam de Baugh
baaa73ee1e fix(ngMocks): $logProvider should not use internal APIs
angular.mocks.$LogProvider $logProvider.debugEnabled(false) is crashing
with undefined when run inside karma/jasmine test runner:

angular.module('foo', []).config(['$logProvider', function ($logProvider) {
  $logProvider.debugEnabled(false);
}]);

Closes #3612
2013-08-29 12:06:30 -07:00
Colin Frei
c65fcc003d docs($q): document notify behavior
Closes #3341
2013-08-29 11:50:52 -07:00
Igor Minar
4114f9c21b revert: feat(mocks): make $timeout#flush throw an exception when empty
This reverts commit cbf06a5d64.

This turned out to be a bad idea because it allow us to fast-forward
the wall clock time (see previous commit).
2013-08-27 17:23:36 -07:00
Igor Minar
70b44ad32a revert: fix(mocks): $timeout#flush should not update time when empty
This reverts commit 42af8eada2.

This turned out to be a bad idea as it prevents us from moving the
time forward and asserting that the component state didn't change
due to the scheduled task executing too early.
2013-08-27 17:21:11 -07:00
Igor Minar
0f56cfdd13 style($http): remove unused argument 2013-08-27 15:57:01 -07:00
Igor Minar
6382e21fb2 fix(i18n): remove obsolete locale files
Remove obsolete locale files that are not found in Google Closure library.

I don't know why they were removed, but without a link to Closure we can't
maintain these files going forward so I'm deleting them.

BREAKING CHANGE: some non-common region-specific local files were removed.
2013-08-27 15:55:37 -07:00
Igor Minar
6b91aa0a18 feat(Scope): async auto-flush $evalAsync queue when outside of $digest
This change causes a new $digest to be scheduled in the next tick if
a task was was sent to the $evalAsync queue from outside of a $digest
or an $apply.

While this mode of operation is not common for most of the user code,
this change means that $q promises that utilze $evalAsync queue to
guarantee asynchronicity of promise apis will now also resolve outside
of a $digest, which turned out to be a big pain point for some developers.

The implementation ensures that we don't do more work than needed and
that we coalese as much work as possible into a single $digest.

The use of $browser instead of setTimeout ensures that we can mock out
and control the scheduling of "auto-flush", which should in theory
allow all of the existing code and tests to work without negative
side-effects.

Closes #3539
Closes #2438
2013-08-26 09:06:25 -07:00
Igor Minar
42af8eada2 fix(mocks): $timeout#flush should not update time when empty
When $timeout#flush is called with a delay and no task can be flushed within that
delay, the current time should not be updated as that gets the mock into an inconsistent
state.

BREAKING CHANGE: if a tests was written around the buggy behavior the delays might be off now

This would typically not be a problem, but because of the previous breaking change in
$timeout.flush, the combination of two might be confusing and that's why we are documenting
it.

Old behavior:

```
doSomething(); //schedules task to execute in 500ms from now
doOtherStuff(); //schedules task to execute in 600ms from now

try {
  $timeout.flush(300); // throws "no task to be flushed" exception
} catch(e) {};
$time.flush(200); //flushes only doSomething() task
```

New behavior:

```
doSomething(); //schedules task to execute in 500ms from now
doOtherStuff(); //schedules task to execute in 600ms from now

try {
  $timeout.flush(300); // throws "no task to be flushed" exception
} catch(e) {};
$time.flush(200); // throws "no task to be flushed" exception again
                  // because previous exception didn't move the time forward
```

Fixed test:

```
doSomething(); //schedules task to execute in 500ms from now
doOtherStuff(); //schedules task to execute in 600ms from now

try {
  $timeout.flush(300); // throws "no task to be flushed" exception
} catch(e) {};
$time.flush(500); // flushes only doSomething() task
```
2013-08-25 14:46:55 -07:00
Igor Minar
cbf06a5d64 feat(mocks): make $timeout#flush throw an exception when empty
When calling $timeout.flush with or without a delay an exception should
be thrown if there is nothing to be flushed.

This prevents tests from flushing stuff unnecessarily.

BREAKING CHANGE: calling $timeout.flush(delay) when there is no task to be flushed
within the delay throws an exception now.

Please adjust the delay or remove the flush call from your tests as the exception
is a signed of a programming error.
2013-08-25 14:46:54 -07:00
Igor Minar
5d9f42050a fix($q): reject should catch & forward exceptions thrown in errback 2013-08-24 12:49:46 -07:00
Igor Minar
1d06a94385 chore: reorganize test helper files under test/helpers 2013-08-23 15:46:11 -07:00
Matias Niemelä
7c605ddf1c fix($animate): skip ngAnimate animations if the provided element already has transitions/durations attached to it
Closes #3587
2013-08-23 14:04:35 -07:00
Matias Niemelä
ee2f3d21da fix($animate): only execute a timeout when transitions or keyframe animations are used
ngAnimate causes a 1ms flicker on the screen when no CSS animations are present on the element.
The solution is to change $animate to only use $timeouts when a duration is found on the element
before the transition/keyframe animation takes over.

Closes #3613
2013-08-23 14:04:35 -07:00
Matias Niemelä
fb3a7db080 feat(ngMock): add support for creating dynamic style sheets within test code 2013-08-23 14:04:35 -07:00
Dusan Bartos
eefcdad013 fix($sniffer): history problems on Boxee box
History API not working properly on Boxee box browser (old Webkit)
problem similar to the one on Android < 4
2013-08-23 11:57:55 -07:00
Chirayu Krishnappa
699f86c535 revert: fix($sce): allow IE7 standards mode to pass non-quirks mode test
This reverts commit 637c9b1611.
(ref #3633 and #3646)

The minimum bar for $sce is IE8 in standards mode.  IE7 standards mode
is not supported.  If you must support IE7, you should disable $sce
completely.

  angular.module('ie7support', []).config(function($sceProvider) {
    // Completely disable SCE to support IE7.
    $sceProvider.enabled(false);
  });
2013-08-22 18:42:21 -07:00
Brian Ford
57c43dd376 docs(module): improve the installation instructions for optional modules
Currently, the documentation does a bad job of explaining the distinction between the services that it provides,
and the module itself. Furthermore, the instructions for using optional modules are inconsistent or missing.
This commit addresses the problem by ading a new `{@installModule foo}` annotation to the docs generator that
inlines the appropriate instructions based on the name of the module.
2013-08-22 16:55:54 -07:00
Brian Ford
7d188d630c fix($q): fix forwarding resolution when callbacks aren't functions
Uses the changes from @jamestalmage's fix in #3535. (thanks!)

Closes #3535
2013-08-21 16:58:40 -07:00
Adam Shannon
8ee9a3e902 fix(docs): Replace missing end tilde in resource docs for minerr. 2013-08-21 16:43:03 -07:00
Sequoia McDowell
411c84bf2c docs(angular.module): improve docs
it wasn't clear before that if given the same name a second time this method RETRIEVES an EXISTING module.  Not even sure if my description is accurate, hoping someone will either confirm and merge or clear it up.

Closes #3666
2013-08-21 02:20:56 -07:00
justinrknowles
637c9b1611 fix($sce): allow IE7 standards mode to pass non-quirks mode test
Changes documentMode test version to 7 in order to support IE 8 in IE 7 standards
mode while still protecting against quirks mode.

documentMode returns the following values:
5 - quirks mode,
7 - IE 7 standards mode,
8 - IE 8 standards mode.

Closes #3633
Closes #3646
2013-08-21 01:38:39 -07:00
Igor Minar
eed299a31b fix(ngTransclude): clear the translusion point before transcluding
when the transluded content is being teleported to the translusion point, we should ensure that
the translusion point is empty before appending otherwise we end up with junk before the transcluded
content
2013-08-20 23:31:38 -07:00
Igor Minar
bf79bd4194 fix(ngTransclude): make the transclusion available to parent post-link
previously the translusion was appended the the ngTranslude element via
$evalAsync which makes the transluded dom unavailable to parent
post-linking functions. By appending translusion in linking phase,
post-linking functions will be able to access it.
2013-08-20 23:31:38 -07:00
Chirayu Krishnappa
ffe1665d02 docs(sce,urlutils): update table to use marked syntax
Commit 258cae83dc replaced Showdown with marked.
2013-08-20 11:35:01 -07:00
Matias Niemelä
b1a43cd04e fix($sniffer): ensure older versions of webkit work for animations 2013-08-19 15:51:28 -07:00
Matias Niemelä
b7a54497b5 revert(ngView): remove ngView manual transclusion system 2013-08-19 14:55:19 -07:00
Matias Niemelä
6749fef227 revert(ngInclude): remove ngInclude manual transclusion system 2013-08-19 14:55:19 -07:00
Misha Moroshko
b43c09c372 docs($sce): fix parseAsHtml link 2013-08-16 19:48:04 -07:00
Igor Minar
44b6b72e5e fix($injector): don't parse fns with no args
When annotating a fn, it is wasteful to try to parse a fn that has no arguments
as such fn has no injectable dependencies
2013-08-16 11:01:51 -07:00
Tom Dunstan
3bc4e7fd20 fix(filter): filter on false properties
Code was evaluating !expression[key] while attempting to
see if the key was present, but this was evaluating to true for
false values as well as missing keys.

Closes #2797.
2013-08-15 15:50:34 -07:00
Jussi Kosunen
3a65822023 fix($parse): handle promises returned from parsed function calls
When a parsed function call returns a promise, the evaluated value
is the resolved value of the promise rather than the promise object.

Closes #3503
2013-08-15 15:15:27 -07:00
Ken Sheedlo
37123cd285 feat(minerr): log minerr doc url in development
Closes #3566
2013-08-15 13:23:18 -07:00
Josh Taylor
8a000a586d style($route): make some jshint recommended changes
Syntax changes:
- ternary indentation
- remove unused variable, N
- use triple equals instead of double

Closes #3559
2013-08-15 10:40:49 -07:00
Reto Aebersold
dba5e16269 docs($route): add hint for ngRoute module inclusion
Closes #3583
2013-08-15 10:34:23 -07:00
Rob Dodson
380854fd2c docs($cookies): add info about angular-cookies.js
per the [top comment here](http://docs.angularjs.org/api/ngCookies.$cookies#comment-912064775)

updating documentation so it matches [$resource](http://docs.angularjs.org/api/ngResource.$resource)
and instructs the user to include the `angular-cookies.js` and load `ngCookies`.

Closes #3607
2013-08-15 10:24:27 -07:00
Igor Minar
680b8174ac docs($interpolate): fix example for provider w/ custom symbols 2013-08-15 08:27:41 -07:00
ItsLeeOwen
5e45fd4ac6 fix(orderBy): remove redundant if statement
Removed unnecessary additional conditional statement.
2013-08-14 16:40:36 -07:00
Andy Gurden
920a380413 fix($timeout): clean deferreds immediately after callback exec/cancel
Make sure $timeout callbacks are forgotten about immediately after
execution or cancellation.

Previously when passing invokeApply=false, the cleanup used $q and so
would be pending until the next $digest was triggered. This does not
make a large functional difference, but can be very visible when
looking at memory consumption of an app or debugging around the
$$asyncQueue - these callbacks can have a big retaining tree.
2013-08-14 14:34:06 -07:00