Commit graph

3366 commits

Author SHA1 Message Date
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
paolo-delmundo
e66c23fe55 fix($sanitize): sanitize DOCTYPE declarations correctly
HTML to be sanitized that contains a DOCTYPE declaration were causing
the HTML parser to throw an error.  Now the parser correctly removes
the declarations when sanitizing HTML.

Closes #3931
2013-10-03 08:42:15 +01:00
jankuca
e36e28ebd4 fix($resource): pass transformed value to both callbacks and promises
Closes #3817
2013-10-02 17:03:53 -07:00
Daniel Luz
5b8c78843e fix(isArrayLike): correctly handle string primitives
Closes #3356
2013-10-02 16:57:26 -07:00
Vojta Jina
fc8034b352 feat(ngMock.$timeout): remove flushNext method 2013-10-02 15:59:49 -07:00
Angel Balcarcel
d70711481e fix($location): prevent infinite digest error in IE7
Refactored `replacedUrl` to store the new URL on both
`location.replace` and setting `location.href` directly to handle
delays in the actual location value change in IE.

Closes #2802
2013-10-02 15:33:31 -07:00
Chirayu Krishnappa
78a5889bc6 test($sce): ie8 fix for entire file
Ref: https://github.com/angular/angular.js/pull/4221#/issuecomment-25515813

Closes #4221
2013-10-02 12:06:27 -07:00
Lucas Galfasó
10cc1a42c9 fix($scope): $evalAsync executes on the right scope
Executes $evalAsync at the scope that the call was made

Closes: #3548
2013-10-02 11:10:29 -07:00
Buu Nguyen
40414827f4 docs($compile): improve explanation of Attributes.$observe
The current comment of Attributes.$observe doesn't state correctly the behavior when the attribute contains no interpolation. Specifically, it states that the observer function will never be invoked if the attribute contains no interpolation. However, the actual behavior in this case is that the observer will be invoked once during the next digest loop.
2013-10-02 10:54:16 -07:00
Jamie Mason
8e6e3ebad9 fix($compile): ng-attr to support dash separated attribute names 2013-10-02 10:52:31 -07:00
Pete Bacon Darwin
ac72bee400 style(rootScopeSpec): add semi-colons 2013-10-02 14:15:09 +01:00
Pete Bacon Darwin
2977067726 style($qSpec): add semi-colons 2013-10-02 14:12:35 +01:00
Chirayu Krishnappa
6231a7cf6a test($sce): make ie8 happy
Ref: https://github.com/angular/angular.js/pull/4221#/issuecomment-25515813

Closes #4221
2013-10-01 23:47:01 -07:00
Ben McCann
e773029717 feat($compile): support tel: links in a[href]
Allow `tel:` links so that click-to-call works in mobile browsers
2013-10-01 16:17:07 -07:00
Francesco Pontillo
8e1276c011 fix($compile): allow interpolations for non-event handlers attrs
Fix wrong behaviour that didn't allow 'data-on' and 'on' element attributes
to be interpolated by $compile. The regex now accepts any string beginning
with 'on' and with at least one more English letter.
2013-10-01 15:08:23 -07:00
Matthew Kleiman
6972596ce9 docs(ngRoute): add angularEvent param to $routeChangeStart event
Adds missing implied first argument, `angularEvent`, to match
the rest of the `$routeChange` event documentation.
2013-10-01 14:36:54 -07:00
Ricardo Bin
e9a222418a fix($httpBackend): set headers with falsy values
This is a breaking change. To migrate to the new behavior,
delete or set headers to `undefined` to avoid having them sent.
To restore the old behavior, override `$httpBackendProvider`
with the old implementation.

Closes #2984
2013-10-01 14:02:00 -07:00
Michał Gołębiowski
936101041a chore(grunt): switch to the new //# sourceMappingURL pragma
All browsers except from Chrome implemented both the old
"//@ sourceMappingURL" and the new "//# sourceMappingURL" pragmas
in the same version so the only reason to keep the old one was Chrome.
However, Chrome 29, i.e. current stable version already supports
the new pragma so there's no need to wait any longer.
2013-10-01 12:30:50 -07:00
Matias Niemelä
2a63dfa6cc fix($animator): avoid completing the animation asynchronously unless CSS transtiions/animations are present
Closes #4023
Closes #3940
2013-10-01 15:00:16 -04:00
James Roper
0d0330adc2 fix($httpBackend): don't send empty string bodies
The `XMLHttpRequest.send` spec defines different semantics for `null`
than for an empty String: an empty String should be sent with a
`Content-Type` of `text/plain`, whereas `null` should have no
`Content-Type` header set.

Closes #2149
2013-10-01 11:28:21 -07:00
jquadrin
0ca5426184 chore: remove Firefox CORS workaround
See #1468
2013-10-01 10:26:08 -07:00
Henning Teek
025c921903 fix(dateFilter): allow negative millisecond value strings 2013-10-01 10:18:03 -07:00
Michał Gołębiowski
ac2d06b19d chore($ngAnimate): simplify vendor prefixes handling in tests 2013-10-01 10:00:43 -04:00
Michał Gołębiowski
f316c314ca refactor($ngAnimate): simplify the animation event rewrite
To avoid code duplication, use single variables for keeping
properties/events names to use. Also, fix some errors that have
happened after the rewrite from moment ago.
2013-10-01 10:00:35 -04:00
Colin Casey
4033cf2814 feat(filter): allow map of filters to be registered
This feature adds similar functionality to what `$ControllerProvider.register`
and `$CompileProvider.directive` currently provide by allowing a map of filter
name/factories to be passed as the sole argument to `$FilterProvider.register`
to register all of the specified filters.

Closes #4036
Closes #4091
2013-10-01 10:26:36 +01:00
Stefan hr Berder
587e8e2ba5 refactor(select): simplify the ngOptions regular expression
\w matches [a-zA-Z0-9_] and \d matches [0-9], using both in a character set is
simply redundant.

Closes #3903
2013-10-01 10:06:15 +01:00
Chirayu Krishnappa
93ce5923e9 feat($sce): simpler patterns for $sceDelegateProviders white/blacklists
Closes #4006
2013-10-01 00:41:07 -07:00
James Daily
1f686c489d fix(docs.js): handle empty deps array for plunkr/jsfiddle
Change return value of docsApp.serviceFactory.prepareDefaultAppModule
to include empty array `[]` instead of array containing one empty
string element `['']`.

This will correct script.js for simple plunkr/jsfiddle examples such
as [ngChecked](http://docs.angularjs.org/api/ng.directive:ngChecked).
2013-09-30 17:52:28 -07:00
Caitlin Potter
ba38de2212 docs($injector): Reword fn param docs and link to DI information 2013-09-30 17:26:00 -07:00
jankuca
5a1a6b86a8 fix(ngTransclude): detect ngTranslude usage without a transclusion directive
Closes #3759
2013-09-30 16:44:19 -07:00
Vojta Jina
742271ffa3 fix($compile): link parents before traversing
How did compiling a templateUrl (async) directive with `replace:true` work before this commit?
1/ apply all directives with higher priority than the templateUrl directive
2/ partially apply the templateUrl directive (create `beforeTemplateNodeLinkFn`)
3/ fetch the template
4/ apply second part of the templateUrl directive on the fetched template
(`afterTemplateNodeLinkFn`)

That is, the templateUrl directive is basically split into two parts (two `nodeLinkFn` functions),
which has to be both applied.

Normally we compose linking functions (`nodeLinkFn`) using continuation - calling the linking
function of a parent element, passing the linking function of the child elements as an argument. The
parent linking function then does:
1/ execute its pre-link functions
2/ call the child elements linking function (traverse)
3/ execute its post-link functions

Now, we have two linking functions for the same DOM element level (because the templateUrl directive
has been split).

There has been multiple issues because of the order of these two linking functions (creating
controller before setting up scope locals, running linking functions before instantiating
controller, etc.). It is easy to fix one use case, but it breaks some other use case. It is hard to
decide what is the "correct" order of these two linking functions as they are essentially on the
same level.

Running them side-by-side screws up pre/post linking functions for the high priority directives
(those executed before the templateUrl directive). It runs post-linking functions before traversing:
```js
beforeTemplateNodeLinkFn(null); // do not travers
afterTemplateNodeLinkFn(afterTemplateChildLinkFn);
```

Composing them (in any order) screws up the order of post-linking functions. We could fix this by
having post-linking functions to execute in reverse order (from the lowest priority to the highest)
which might actually make a sense.

**My solution is to remove this splitting.** This commit removes the `beforeTemplateNodeLinkFn`. The
first run (before we have the template) only schedules fetching the template. The rest (creating
scope locals, instantiating a controller, linking functions, etc) is done when processing the
directive again (in the context of the already fetched template; this is the cloned
`derivedSyncDirective`).

We still need to pass-through the linking functions of the higher priority directives (those
executed before the templateUrl directive), that's why I added `preLinkFns` and `postLinkFns`
arguments to `applyDirectivesToNode`.

This also changes the "$compile transclude should make the result of a transclusion available to the
parent directive in post- linking phase (templateUrl)" unit test. It was testing that a parent
directive can see the content of transclusion in its pre-link function. That is IMHO wrong (as the
`ngTransclude` directive inserts the translusion in its linking function). This test was only passing because of
c173ca4128, which changed the behavior of the compiler to traverse
before executing the parent linking function. That was wrong and also caused the #3792 issue, which
this change fixes.

Closes #3792
Closes #3923
Closes #3935
Closes #3927
2013-09-30 15:30:29 -07:00
Michał Gołębiowski
df9426dbc6 chore(package.json): update npm packages
Some of node dependencies have much newer versions; one of them is Lo-Dash
that has recently released the 2.0.0 version bringing in new useful methods.
2013-09-30 14:52:20 -07:00
Ron Waldon
106ee8f850 docs(guide): describe directive replace:false
Previous version stated `replace:false` will append template to element.
Improve description to accurately state that template will _replace_ the
contents of the current element.

Closes #2235, #4166
2013-09-30 22:51:01 +01:00
Uri Goldshtein
fc05f5e701 docs(angular.copy): add an example with the two possible arguments
Closes #4179
2013-09-30 22:15:57 +01:00
Fred Sauer
06a611c4b4 docs($route): reloadOnSearch affects hash fragment changes
reloadOnSearch also affects reloads due to $location.hash() changes
2013-09-30 14:04:59 -07:00
Martin Cortez
0868a076e0 docs($http): update grammar in comments
Closes #4186
2013-09-30 21:44:35 +01:00
Richard Sentino
d79822e73a docs(tutorial/step0): fix minor typo
Closes #4154
2013-09-30 21:28:19 +01:00