Commit Graph

488 Commits

Author SHA1 Message Date
Richard Littauer
36b2bba05f docs(guide/directive): explain controllerAs option
There was nothing about controllerAs in the developer guide.

Helps #6710 and #6759
2014-06-03 17:56:37 -07:00
Tim Ruffles
011914121c docs(guide/expression): fix docs re $window
The documentation on context is incorrect and misleading:

1. "Angular expressions must use $window explicitly to refer to the global
   `window` object": expressions cannot access `$window`
1. The example doesn't actually attempt to use $window in a expression. It's in a
   function called from an expression, which incorrectly implies to readers that:
  1. functions ARE expressions
  1. functions called by expressions can't access `window`

Here's [a plunkr](http://plnkr.co/edit/Gd4xAV?p=preview) to make both these issues clear.

This change fixes the errors and informs the reader about Angular's `$window` etc services,
and adds an explicit example of an expression not being able to access `window`.
2014-06-03 16:20:59 -07:00
Oivvio Polite
575b197c27 docs(guide/providers): fix typo 2014-06-03 15:39:49 -07:00
Oivvio Polite
cc495e136d docs(guide/providers): fix grammar 2014-06-03 14:32:33 -07:00
Lucas Galfaso
cee429f0aa feat(*): lazy one-time binding support
Expressions that start with `::` will be binded once. The rule
that binding follows is that the binding will take the first
not-undefined value at the end of a $digest cycle.

Watchers from $watch, $watchCollection and $watchGroup will
automatically stop watching when the expression(s) are bind-once
and fulfill.

Watchers from text and attributes interpolations will
automatically stop watching when the expressions are fulfill.

All directives that use $parse for expressions will automatically
work with bind-once expressions. E.g.

<div ng-bind="::foo"></div>
<li ng-repeat="item in ::items">{{::item.name}};</li>

Paired with: Caitlin and Igor
Design doc: https://docs.google.com/document/d/1fTqaaQYD2QE1rz-OywvRKFSpZirbWUPsnfaZaMq8fWI/edit#
Closes #7486
Closes #5408
2014-05-23 14:40:51 -07:00
Andrew Mortimer
f5f1fd1963 docs(guide/controller): fix typo 2014-05-21 12:31:26 -07:00
markau
bdfbceb3d3 docs(guide/concepts): The service is finance2.js
Closes #7470
2014-05-21 10:47:21 -07:00
Tobias Bosch
f9264eec07 docs(guide/concepts): clarify definitions 2014-05-21 10:47:09 -07:00
Erich
9fb0e16719 docs(guide/concepts): clarify definitions
Closes #7483
2014-05-21 10:33:11 -07:00
Sam Dornan
20221f9582 docs(guide/services): fix link to minify Wikipedia page
Closes #7488
2014-05-21 10:29:13 -07:00
Caitlin Potter
d8c55864d0 docs(guide/$location): clarify "$watchers" / "$observers" terminology with links
Add links to API docs for Scope#$watch and Attributes#$observe in $location in order to clarify
the meaning of that terminology.

Closes #7497
2014-05-21 11:58:52 -04:00
Peter Bacon Darwin
e3375ae37e docs(guide/expression): mention the ternary operator
Closes #6498
2014-05-21 14:46:05 +01:00
Andrey Sidorov
35e53ca649 docs(guide): correct order of directive arguments within the animations chapter
Closes #7482
2014-05-19 14:27:58 -04:00
Diego Plentz
0dfbf8ad67 docs(guide/$location) remove duplicate 'Crawling your app' section
The "Crawling your app" section was duplicated.
I just removed the duplication and moved the section to the 'Caveats' section.

Closes #7244
2014-05-19 14:05:46 +01:00
Jonathan Gotti
d1f1a1abdd docs(guide/directives): improve links to isolate scope docs
Link "isolate scope" to "Directive Definition object" section

Closes #7484
2014-05-16 11:22:01 -07:00
Zachary Babtkis
a4ec1187d6 docs(guide/css-styling): tiny grammar fix
Closes #5443
2014-05-16 14:52:24 +01:00
Peter Bacon Darwin
35a6646a81 docs(guide/services): add reference to ngmin tool
Closes #5908
2014-05-16 12:33:05 +01:00
Christopher Rose
a84344adb6 docs(guide/di): fix typos
Closes #7480
2014-05-15 20:56:54 +01:00
Thomas Tuts
055b738d4e docs(directive): fix misspelled HTML class for an alert
Muchas gracias

Closes #7381
2014-05-07 07:59:18 -04:00
mjfroehlich
b426424e63 docs(guide/providers): minor edits 2014-05-01 14:39:55 -07:00
Uri Goldshtein
fcc3a7a423 docs(guide): add another analytics library 2014-04-28 12:04:06 -07:00
Thomas Tuts
2022fd768e docs(guide/unit-testing): remove unwanted whitespaces
Closes #5395
2014-04-28 14:39:54 +01:00
Michael Payne
737ef25df1 docs(guide/di): fix typo
Fixed a typo. "depenendencies" -> "dependencies"

Closes #7232
2014-04-24 13:27:53 -04:00
Michał Gołębiowski
92e8289c12 refactor(jqLite): change leftover element.bind/unbind to element.on/off 2014-04-22 16:03:22 +02:00
Matthew Davies
6ab7adda3c docs(guide/controller): fixed spelling of spiciness
Closes #7185
2014-04-21 16:04:39 -07:00
Igor Minar
9178c318e1 docs(guide/forms): fix quotes around updateOn that broke ngModelOptions example 2014-04-21 14:53:04 -07:00
Valentin Waeselynck
613a5cc5db docs(guide/e2e-testing): remove inconsistency in first paragraph
Change the "first line of defense" to unit tests, not end-to-end tests.
2014-04-11 19:26:25 +01:00
Valentin Waeselynck
61a8e198bd docs(guide/e2e-testing): remove repeated word 'manually'
Fixed repetition in Caveats paragraph

"manually" was repeated. Grammatical correctness is the prime directive, resistance is futile.

Closes #7073
2014-04-10 10:59:02 -04:00
Steven Benjamin
6743ccf788 docs(guide/directive): directives can be comments, too
While it's not a widely used feature, and likely shouldn't be recommended, it is
possible to use a directive via a comment node.

Closes #7061
2014-04-10 06:46:05 -04:00
Lefteris Paraskevas
2ad7bb9ca9 docs(guide/unit-testing): fix small typo (than instead of then) 2014-04-10 00:49:59 +01:00
Julie
acfcbdf906 docs(e2e-testing): deprecate ng-scenario and update E2E testing doc to discuss protractor 2014-04-09 11:05:43 -07:00
Rosseyn
879b0bc9f9 docs(guide/ie): fix spelling mistake
Closes #7050
2014-04-08 18:46:18 -04:00
Jason Travis
a8d42800e7 docs(guide): fix dropped word in controller description
Closes #7026
2014-04-07 07:46:20 -04:00
Jonathan Sampson
28613f0eae docs(guide/providers): fix grammar in note regarding factory naming conventions
It seems as though this sentence wasn't written the way it was originally planned. I did my best to
approximate the intent of the original author.

Closes #7022
2014-04-06 22:05:34 -04:00
Peter Bacon Darwin
abddefd057 docs(guide/di): clarify what can be injected into what
Also do some general housekeeping and tidying of the page.

Closes #6999
2014-04-06 17:22:24 +01:00
martco
4ae5f7a477 docs(guide/directive): grammatical fixup
The 'to' in 'end-to-end' is directional, not numeric

Closes #6895
2014-04-05 09:48:30 -04:00
Luis Ramón López
dbe381f29f feat(ngModelOptions): custom triggers and debounce of ngModel updates
By default, any change to an input will trigger an immediate model update,
form validation and run a $digest. This is not always desirable, especially
when you have a large number of bindings to update.

This PR implements a new directive `ngModelOptions`, which allow you to
override this default behavior in several ways. It is implemented as an
attribute, to which you pass an Angular expression, which evaluates to an
**options** object.

All inputs, using ngModel, will search for this directive in their ancestors
and use it if found.  This makes it easy to provide options for a whole
form or even the whole page, as well as specifying exceptions for
individual inputs.

* You can specify what events trigger an update to the model by providing
  an `updateOn` property on the **options** object. This property takes a
  string containing a space separated list of events.

  For example, `ng-model-options="{ updateOn: 'blur' }"` will update the
  model only after the input loses focus.

  There is a special pseudo-event, called "default", which maps to the
  default event used by the input box normally. This is useful if you
  want to keep the default behavior and just add new events.

* You can specify a debounce delay, how long to wait after the last triggering
  event before updating the model, by providing a `debounce` property on
  the **options** object.

  This property can be a simple number, the
  debounce delay for all events. For example,
  `ng-model-options="{ debounce: 500 }" will ensure the model is updated
  only when there has been a period 500ms since the last triggering event.

  The property can also be an object, where the keys map to events and
  the values are a corresponding debounce delay for that event.
  This can be useful to force immediate updates on some specific
  circumstances (like blur events). For example,
  `ng-model-options="{ updateOn: 'default blur', debounce: { default: 500, blur: 0} }"`

This commit also brings to an end one of the longest running Pull Requests
in the history of AngularJS (#2129)!  A testament to the patience of @lrlopez.

Closes #1285, #2129, #6945
2014-04-04 14:48:53 +01:00
Joseph Orbegoso Pea
b63fd11800 docs(guide/scope): small fixes 2014-04-03 16:09:10 -07:00
Jonathan Woodard
6cd6ec62fd docs(guide/bootstrap): remove extra call to angular.module()
There was an extra call to angular.module() not being used in 'getter' mode. While this doesn't
break the demo app, it does look kind of weird, so lets toss it.

Closes #6969
2014-04-02 23:55:18 -04:00
Pascal Precht
ccfa72dfa1 docs(guide): fix link in "Complementary libraries" section
the link to `angular-translate` is outdated. this commit fixes it.
2014-04-02 16:07:58 -07:00
Joseph Orbegoso Pea
47384bc61b docs(guide/bootstrap): add note about ngApp and manual bootstrap 2014-03-31 16:57:49 -07:00
tamakisquare
d0df8c8946 docs(guide/filter): mention that filters can be used in directives
The doc mentions filters can be used in services and controllers but directives
aren't mentioned. This could lead to confusion for beginners.
2014-03-27 15:36:25 -07:00
Uri Goldshtein
b1d1cb6b7a docs(guide): add ngStorage to specific topics 2014-03-27 14:29:16 -07:00
Narretz
a2aa667777 docs(guide/scope): fix links to $interpolate
Closes #6877
2014-03-27 14:31:14 -04:00
Igor Minar
3bf8d6c612 docs(guide/unit-testing): fix link 2014-03-26 03:50:31 -07:00
Alex Miller
372e31ae84 docs(guide/migration): clarify some confusing points
Closes #6756
2014-03-26 03:28:42 -07:00
Nikita Tovstoles
273e34e3de docs(guide/unit-testing): recommend pre-compiling templates
quite a few folks struggle with how to test directives with external templates.
karma-ng-html2js-preprocessor provides an easy solution but the issues is not
raised in the docs.
2014-03-25 17:52:58 -07:00
Brian Ford
98d5885237 docs(guide/filter): fix example style
* use -Controller suffix
* use array annotations
2014-03-25 17:35:44 -07:00
Brian Ford
af042b60db docs(guide/directive): fix example style
* use -Controller suffix
* use array annotations
2014-03-25 17:33:05 -07:00
Brian Ford
f6877ed2d9 docs(guide/controller): use -Controller suffix
Previously, the convention was to end controllers with -Ctrl.
The new convention is to use -Controller
2014-03-25 17:07:47 -07:00