Skip to content

Commit c819488

Browse files
Merge pull request #151 from angular/master
Update upstream
2 parents 299553c + 83f7980 commit c819488

File tree

10 files changed

+1030
-51
lines changed

10 files changed

+1030
-51
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
<a name="1.7.2"></a>
2+
# 1.7.2 extreme-compatiplication (2018-06-12)
3+
4+
In the previous release, we removed a private, undocumented API that was no longer used by
5+
AngularJS. It turned out that several popular UI libraries (such as
6+
[AngularJS Material](https://material.angularjs.org/),
7+
[UI Bootstrap](https://angular-ui.github.io/bootstrap/),
8+
[ngDialog](http://likeastore.github.io/ngDialog/) and probably others) relied on that API.
9+
10+
In order to avoid unnecessary pain for developers, this release reverts the removal of the private
11+
API and restores compatibility of the aforementioned libraries with the latest AngularJS.
12+
13+
## Reverts
14+
- **$compile:** remove `preAssignBindingsEnabled` leftovers
15+
([2da495](https://github.com/angular/angular.js/commit/2da49504065e9e2b71a7a5622e45118d8abbe87e),
16+
[#16580](https://github.com/angular/angular.js/pull/16580),
17+
[a81232](https://github.com/angular/angular.js/commit/a812327acda8bc890a4c4e809f0debb761c29625),
18+
[#16595](https://github.com/angular/angular.js/pull/16595))
19+
20+
121
<a name="1.7.1"></a>
222
# 1.7.1 momentum-defiance (2018-06-08)
323

docs/config/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ module.exports = new Package('angularjs', [
148148

149149
.config(function(checkAnchorLinksProcessor) {
150150
checkAnchorLinksProcessor.base = '/';
151+
checkAnchorLinksProcessor.errorOnUnmatchedLinks = true;
151152
// We are only interested in docs that have an area (i.e. they are pages)
152153
checkAnchorLinksProcessor.checkDoc = function(doc) { return doc.area; };
153154
})

docs/content/misc/version-support-status.ngdoc

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,21 @@ Any version branch not shown in the following table (e.g. 1.5.x) is no longer be
3030
Any version branch not shown in the following table (e.g. 1.6.x) is no longer being developed.
3131

3232
<table class="dev-status table table-bordered">
33-
<thead>
34-
<tr><th>Version</th><th>Status</th><th>Comments</th></tr>
35-
</thead>
36-
<tbody>
37-
<tr class="security"><td><span>1.2.x</span></td><td>Long Term Support</td><td>Last version to provide IE 8 support</td></tr>
38-
<tr class="stable"><td><span>1.7.x</span></td><td>Long Term Support</td><td>See [Long Term Support](#long-term-support) section below.</td></tr>
39-
</tbody>
33+
<thead>
34+
<tr><th>Version</th><th>Status</th><th>Comments</th></tr>
35+
</thead>
36+
<tbody>
37+
<tr class="security">
38+
<td><span>1.2.x</span></td>
39+
<td>Long Term Support</td>
40+
<td>Last version to provide IE 8 support</td>
41+
</tr>
42+
<tr class="stable">
43+
<td><span>1.7.x</span></td>
44+
<td>Long Term Support</td>
45+
<td>See {@link version-support-status#long-term-support Long Term Support} section below.</td>
46+
</tr>
47+
</tbody>
4048
</table>
4149

4250
### Long Term Support
@@ -51,4 +59,4 @@ At this time we will focus exclusively on providing fixes to bugs that satisfy a
5159

5260
### Blog Post
5361

54-
You can read more about these plans in our [blog post announcement](https://blog.angular.io/stable-angularjs-and-long-term-support-7e077635ee9c).
62+
You can read more about these plans in our [blog post announcement](https://blog.angular.io/stable-angularjs-and-long-term-support-7e077635ee9c).

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"commitplease": "^2.7.10",
3333
"cross-spawn": "^4.0.0",
3434
"cz-conventional-changelog": "1.1.4",
35-
"dgeni": "^0.4.0",
36-
"dgeni-packages": "^0.16.4",
35+
"dgeni": "^0.4.9",
36+
"dgeni-packages": "^0.26.2",
3737
"eslint-plugin-promise": "^3.6.0",
3838
"event-stream": "~3.1.0",
3939
"glob": "^6.0.1",

src/ng/directive/input.js

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ var inputType = {
255255
* The timezone to be used to read/write the `Date` instance in the model can be defined using
256256
* {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.
257257
*
258+
* The format of the displayed time can be adjusted with the
259+
* {@link ng.directive:ngModelOptions#ngModelOptions-arguments ngModelOptions} `timeSecondsFormat`
260+
* and `timeStripZeroSeconds`.
261+
*
258262
* @param {string} ngModel Assignable AngularJS expression to data-bind to.
259263
* @param {string=} name Property name of the form under which the control is published.
260264
* @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
@@ -356,7 +360,12 @@ var inputType = {
356360
* Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.
357361
*
358362
* The timezone to be used to read/write the `Date` instance in the model can be defined using
359-
* {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.
363+
* {@link ng.directive:ngModelOptions#ngModelOptions-arguments ngModelOptions}. By default,
364+
* this is the timezone of the browser.
365+
*
366+
* The format of the displayed time can be adjusted with the
367+
* {@link ng.directive:ngModelOptions#ngModelOptions-arguments ngModelOptions} `timeSecondsFormat`
368+
* and `timeStripZeroSeconds`.
360369
*
361370
* @param {string} ngModel Assignable AngularJS expression to data-bind to.
362371
* @param {string=} name Property name of the form under which the control is published.
@@ -1491,6 +1500,8 @@ function createDateInputType(type, regexp, parseDate, format) {
14911500
return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter) {
14921501
badInputChecker(scope, element, attr, ctrl, type);
14931502
baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
1503+
1504+
var isTimeType = type === 'time' || type === 'datetimelocal';
14941505
var previousDate;
14951506
var previousTimezone;
14961507

@@ -1514,11 +1525,13 @@ function createDateInputType(type, regexp, parseDate, format) {
15141525
if (isValidDate(value)) {
15151526
previousDate = value;
15161527
var timezone = ctrl.$options.getOption('timezone');
1528+
15171529
if (timezone) {
15181530
previousTimezone = timezone;
15191531
previousDate = convertTimezoneToLocal(previousDate, timezone, true);
15201532
}
1521-
return $filter('date')(value, format, timezone);
1533+
1534+
return formatter(value, timezone);
15221535
} else {
15231536
previousDate = null;
15241537
previousTimezone = null;
@@ -1573,6 +1586,24 @@ function createDateInputType(type, regexp, parseDate, format) {
15731586
}
15741587
return parsedDate;
15751588
}
1589+
1590+
function formatter(value, timezone) {
1591+
var targetFormat = format;
1592+
1593+
if (isTimeType && isString(ctrl.$options.getOption('timeSecondsFormat'))) {
1594+
targetFormat = format
1595+
.replace('ss.sss', ctrl.$options.getOption('timeSecondsFormat'))
1596+
.replace(/:$/, '');
1597+
}
1598+
1599+
var formatted = $filter('date')(value, targetFormat, timezone);
1600+
1601+
if (isTimeType && ctrl.$options.getOption('timeStripZeroSeconds')) {
1602+
formatted = formatted.replace(/(?::00)?(?:\.000)?$/, '');
1603+
}
1604+
1605+
return formatted;
1606+
}
15761607
};
15771608
}
15781609

src/ng/directive/ngModelOptions.js

Lines changed: 85 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -406,12 +406,6 @@ defaultModelOptions = new ModelOptions({
406406
* </example>
407407
*
408408
*
409-
* ## Specifying timezones
410-
*
411-
* You can specify the timezone that date/time input directives expect by providing its name in the
412-
* `timezone` property.
413-
*
414-
*
415409
* ## Programmatically changing options
416410
*
417411
* The `ngModelOptions` expression is only evaluated once when the directive is linked; it is not
@@ -423,8 +417,70 @@ defaultModelOptions = new ModelOptions({
423417
* Default events, extra triggers, and catch-all debounce values}.
424418
*
425419
*
420+
* ## Specifying timezones
421+
*
422+
* You can specify the timezone that date/time input directives expect by providing its name in the
423+
* `timezone` property.
424+
*
425+
*
426+
* ## Formatting the value of `time` and `datetime-local`
427+
*
428+
* With the options `timeSecondsFormat` and `timeStripZeroSeconds` it is possible to adjust the value
429+
* that is displayed in the control. Note that browsers may apply their own formatting
430+
* in the user interface.
431+
*
432+
<example name="ngModelOptions-time-format" module="timeExample">
433+
<file name="index.html">
434+
<time-example></time-example>
435+
</file>
436+
<file name="script.js">
437+
angular.module('timeExample', [])
438+
.component('timeExample', {
439+
templateUrl: 'timeExample.html',
440+
controller: function() {
441+
this.time = new Date(1970, 0, 1, 14, 57, 0);
442+
443+
this.options = {
444+
timeSecondsFormat: 'ss',
445+
timeStripZeroSeconds: true
446+
};
447+
448+
this.optionChange = function() {
449+
this.timeForm.timeFormatted.$overrideModelOptions(this.options);
450+
this.time = new Date(this.time);
451+
};
452+
}
453+
});
454+
</file>
455+
<file name="timeExample.html">
456+
<form name="$ctrl.timeForm">
457+
<strong>Default</strong>:
458+
<input type="time" ng-model="$ctrl.time" step="any" /><br>
459+
<strong>With options</strong>:
460+
<input type="time" name="timeFormatted" ng-model="$ctrl.time" step="any" ng-model-options="$ctrl.options" />
461+
<br>
462+
463+
Options:<br>
464+
<code>timeSecondsFormat</code>:
465+
<input
466+
type="text"
467+
ng-model="$ctrl.options.timeSecondsFormat"
468+
ng-change="$ctrl.optionChange()">
469+
<br>
470+
<code>timeStripZeroSeconds</code>:
471+
<input
472+
type="checkbox"
473+
ng-model="$ctrl.options.timeStripZeroSeconds"
474+
ng-change="$ctrl.optionChange()">
475+
</form>
476+
</file>
477+
* </example>
478+
*
426479
* @param {Object} ngModelOptions options to apply to {@link ngModel} directives on this element and
427-
* and its descendents. Valid keys are:
480+
* and its descendents.
481+
*
482+
* **General options**:
483+
*
428484
* - `updateOn`: string specifying which event should the input be bound to. You can set several
429485
* events using an space delimited list. There is a special event called `default` that
430486
* matches the default events belonging to the control. These are the events that are bound to
@@ -457,6 +513,10 @@ defaultModelOptions = new ModelOptions({
457513
* not validate correctly instead of the default behavior of setting the model to undefined.
458514
* - `getterSetter`: boolean value which determines whether or not to treat functions bound to
459515
* `ngModel` as getters/setters.
516+
*
517+
*
518+
* **Input-type specific options**:
519+
*
460520
* - `timezone`: Defines the timezone to be used to read/write the `Date` instance in the model for
461521
* `<input type="date" />`, `<input type="time" />`, ... . It understands UTC/GMT and the
462522
* continental US time zone abbreviations, but for general use, use a time zone offset, for
@@ -465,6 +525,24 @@ defaultModelOptions = new ModelOptions({
465525
* Note that changing the timezone will have no effect on the current date, and is only applied after
466526
* the next input / model change.
467527
*
528+
* - `timeSecondsFormat`: Defines if the `time` and `datetime-local` types should show seconds and
529+
* milliseconds. The option follows the format string of {@link date date filter}.
530+
* By default, the options is `undefined` which is equal to `'ss.sss'` (seconds and milliseconds).
531+
* The other options are `'ss'` (strips milliseconds), and `''` (empty string), which strips both
532+
* seconds and milliseconds.
533+
* Note that browsers that support `time` and `datetime-local` require the hour and minutes
534+
* part of the time string, and may show the value differently in the user interface.
535+
* {@link ngModelOptions#formatting-the-value-of-time-and-datetime-local- See the example}.
536+
*
537+
* - `timeStripZeroSeconds`: Defines if the `time` and `datetime-local` types should strip the
538+
* seconds and milliseconds from the formatted value if they are zero. This option is applied
539+
* after `timeSecondsFormat`.
540+
* This option can be used to make the formatting consistent over different browsers, as some
541+
* browsers with support for `time` will natively hide the milliseconds and
542+
* seconds if they are zero, but others won't, and browsers that don't implement these input
543+
* types will always show the full string.
544+
* {@link ngModelOptions#formatting-the-value-of-time-and-datetime-local- See the example}.
545+
*
468546
*/
469547
var ngModelOptionsDirective = function() {
470548
NgModelOptionsController.$inject = ['$attrs', '$scope'];

src/ngAnimate/module.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,9 @@
281281
*
282282
* Sometimes you need to animate between different expression states, whose values
283283
* don't necessary need to be known or referenced in CSS styles.
284-
* Unless possible with another ["animation aware" directive](#directive-support), that specific
285-
* use case can always be covered with {@link ngAnimate.directive:ngAnimateSwap} as can be seen in
286-
* {@link ngAnimate.directive:ngAnimateSwap#examples this example}.
284+
* Unless possible with another {@link ngAnimate#directive-support "animation aware" directive},
285+
* that specific use case can always be covered with {@link ngAnimate.directive:ngAnimateSwap} as
286+
* can be seen in {@link ngAnimate.directive:ngAnimateSwap#examples this example}.
287287
*
288288
* Note that {@link ngAnimate.directive:ngAnimateSwap} is a *structural directive*, which means it
289289
* creates a new instance of the element (including any other/child directives it may have) and

src/ngMessages/messages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ angular.module('ngMessages', [], function initAngularHelpers() {
704704
*
705705
* @description
706706
* `ngMessageDefault` is a directive with the purpose to show and hide a default message for
707-
* {@link ngMessages}, when none of provided messages matches.
707+
* {@link directive:ngMessages}, when none of provided messages matches.
708708
*
709709
* More information about using `ngMessageDefault` can be found in the
710710
* {@link module:ngMessages `ngMessages` module documentation}.

0 commit comments

Comments
 (0)