Skip to content

Update upstream #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/content/guide/animations.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ triggered:
| {@link ng.directive:ngClass#animations ngClassEven / ngClassOdd} | add and remove |
| {@link ng.directive:ngHide#animations ngHide} | add and remove (the `ng-hide` class) |
| {@link ng.directive:ngShow#animations ngShow} | add and remove (the `ng-hide` class) |
| {@link ng.directive:ngModel#animation-hooks ngModel} | add and remove ({@link ng.directive:ngModel#css-classes various classes}) |
| {@link ng.directive:form#animation-hooks form / ngForm} | add and remove ({@link ng.directive:form#css-classes various classes}) |
| {@link ng.directive:ngModel#animations ngModel} | add and remove ({@link ng.directive:ngModel#css-classes various classes}) |
| {@link ng.directive:form#animations form / ngForm} | add and remove ({@link ng.directive:form#css-classes various classes}) |
| {@link module:ngMessages#animations ngMessages} | add and remove (the `ng-active`/`ng-inactive` classes) |

For a full breakdown of the steps involved during each animation event, refer to the
Expand Down
8 changes: 8 additions & 0 deletions src/Angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,10 @@ var isAutoBootstrapAllowed = allowAutoBootstrap(window.document);
* document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`
* would not be resolved to `3`.
*
* @example
*
* ### Simple Usage
*
* `ngApp` is the easiest, and most common way to bootstrap an application.
*
<example module="ngAppDemo" name="ng-app">
Expand All @@ -1610,6 +1614,10 @@ var isAutoBootstrapAllowed = allowAutoBootstrap(window.document);
</file>
</example>
*
* @example
*
* ### With `ngStrictDi`
*
* Using `ngStrictDi`, you would see something like this:
*
<example ng-app-included="true" name="strict-di">
Expand Down
17 changes: 9 additions & 8 deletions src/ng/cacheFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ function $CacheFactoryProvider() {
*
* @description
* A cache object used to store and retrieve data, primarily used by
* {@link $http $http} and the {@link ng.directive:script script} directive to cache
* templates and other data.
* {@link $templateRequest $templateRequest} and the {@link ng.directive:script script}
* directive to cache templates and other data.
*
* ```js
* angular.module('superCache')
Expand Down Expand Up @@ -360,9 +360,12 @@ function $CacheFactoryProvider() {
* @this
*
* @description
* `$templateCache` is a {@link $cacheFactory.Cache Cache object} created by the
* {@link ng.$cacheFactory $cacheFactory}.
*
* The first time a template is used, it is loaded in the template cache for quick retrieval. You
* can load templates directly into the cache in a `script` tag, or by consuming the
* `$templateCache` service directly.
* can load templates directly into the cache in a `script` tag, by using {@link $templateRequest},
* or by consuming the `$templateCache` service directly.
*
* Adding via the `script` tag:
*
Expand All @@ -373,8 +376,8 @@ function $CacheFactoryProvider() {
* ```
*
* **Note:** the `script` tag containing the template does not need to be included in the `head` of
* the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (IE,
* element with ng-app attribute), otherwise the template will be ignored.
* the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (e.g.
* element with {@link ngApp} attribute), otherwise the template will be ignored.
*
* Adding via the `$templateCache` service:
*
Expand All @@ -397,8 +400,6 @@ function $CacheFactoryProvider() {
* $templateCache.get('templateId.html')
* ```
*
* See {@link ng.$cacheFactory $cacheFactory}.
*
*/
function $TemplateCacheProvider() {
this.$get = ['$cacheFactory', function($cacheFactory) {
Expand Down
3 changes: 1 addition & 2 deletions src/ng/directive/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,7 @@ addSetValidityMethod({
* submitted. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`
* to have access to the updated model.
*
* ## Animation Hooks
*
* @animations
* Animations in ngForm are triggered when any of the associated CSS classes are added and removed.
* These classes are: `.ng-pristine`, `.ng-dirty`, `.ng-invalid` and `.ng-valid` as well as any
* other validations that are performed within the form. Animations in ngForm are similar to how
Expand Down
4 changes: 3 additions & 1 deletion src/ng/directive/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -2086,6 +2086,8 @@ var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/;
/**
* @ngdoc directive
* @name ngValue
* @restrict A
* @priority 100
*
* @description
* Binds the given expression to the value of the element.
Expand All @@ -2098,7 +2100,7 @@ var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/;
* It can also be used to achieve one-way binding of a given expression to an input element
* such as an `input[text]` or a `textarea`, when that element does not use ngModel.
*
* @element input
* @element ANY
* @param {string=} ngValue AngularJS expression, whose value will be bound to the `value` attribute
* and `value` property of the element.
*
Expand Down
3 changes: 2 additions & 1 deletion src/ng/directive/ngChange.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/**
* @ngdoc directive
* @name ngChange
* @restrict A
*
* @description
* Evaluate the given expression when the user changes the input.
Expand All @@ -21,7 +22,7 @@
*
* Note, this directive requires `ngModel` to be present.
*
* @element input
* @element ANY
* @param {expression} ngChange {@link guide/expression Expression} to evaluate upon change
* in input value.
*
Expand Down
23 changes: 12 additions & 11 deletions src/ng/directive/ngClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ function classDirective(name, selector) {
* @ngdoc directive
* @name ngClass
* @restrict AC
* @element ANY
*
* @description
* The `ngClass` directive allows you to dynamically set CSS classes on an HTML element by databinding
Expand Down Expand Up @@ -178,14 +179,21 @@ function classDirective(name, selector) {
* | {@link ng.$animate#addClass addClass} | just before the class is applied to the element |
* | {@link ng.$animate#removeClass removeClass} | just before the class is removed from the element |
*
* @element ANY
* ### ngClass and pre-existing CSS3 Transitions/Animations
The ngClass directive still supports CSS3 Transitions/Animations even if they do not follow the ngAnimate CSS naming structure.
Upon animation ngAnimate will apply supplementary CSS classes to track the start and end of an animation, but this will not hinder
any pre-existing CSS transitions already on the element. To get an idea of what happens during a class-based animation, be sure
to view the step by step details of {@link $animate#addClass $animate.addClass} and
{@link $animate#removeClass $animate.removeClass}.
*
* @param {expression} ngClass {@link guide/expression Expression} to eval. The result
* of the evaluation can be a string representing space delimited class
* names, an array, or a map of class names to boolean values. In the case of a map, the
* names of the properties whose values are truthy will be added as css classes to the
* element.
*
* @example Example that demonstrates basic bindings via ngClass directive.
* @example
* ### Basic
<example name="ng-class">
<file name="index.html">
<p ng-class="{strike: deleted, bold: important, 'has-error': error}">Map Syntax Example</p>
Expand Down Expand Up @@ -275,7 +283,8 @@ function classDirective(name, selector) {
</file>
</example>

## Animations
@example
### Animations

The example below demonstrates how to perform animations using ngClass.

Expand Down Expand Up @@ -313,14 +322,6 @@ function classDirective(name, selector) {
});
</file>
</example>


## ngClass and pre-existing CSS3 Transitions/Animations
The ngClass directive still supports CSS3 Transitions/Animations even if they do not follow the ngAnimate CSS naming structure.
Upon animation ngAnimate will apply supplementary CSS classes to track the start and end of an animation, but this will not hinder
any pre-existing CSS transitions already on the element. To get an idea of what happens during a class-based animation, be sure
to view the step by step details of {@link $animate#addClass $animate.addClass} and
{@link $animate#removeClass $animate.removeClass}.
*/
var ngClassDirective = classDirective('', true);

Expand Down
Loading