This repository has been archived by the owner on May 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Update to Angular 1.6 #6427
Closed
Closed
Update to Angular 1.6 #6427
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
34c0858
chore: bump angular version
f75ac4e
fix(accordion): transclusion no longer introduces span
faf7cb8
fix(modal): transclusion no longer introduces span
3a94ba4
fix(collapse): handle promise rejections
bcec969
fix(modal): handle promise rejections
5c086f8
fix(alert): transclusion no longer introduces span
be7ad86
fix(datepicker): $options is always present; use $options.getOption()
92f4180
fix(datepickerPopup): $options is always present
b053fc9
fix(typeahead): $options is always present; use $options.getOption()
e99ce9e
chore: bump angular to latest version of 1.6
35a9868
fix(datepicker): handle $options for Angular 1.5
ac90110
fix(datepickerPopup): handle $options for Angular 1.5
6fe0362
fix(typeahead): handle $options for Angular 1.5
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,7 +104,7 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst | |
$scope.$watch('datepickerOptions.' + key, function(value) { | ||
if (value) { | ||
if (angular.isDate(value)) { | ||
self[key] = dateParser.fromTimezone(new Date(value), ngModelOptions.timezone); | ||
self[key] = dateParser.fromTimezone(new Date(value), ngModelOptions.getOption('timezone')); | ||
} else { | ||
if ($datepickerLiteralWarning) { | ||
$log.warn('Literal date support has been deprecated, please switch to date object usage'); | ||
|
@@ -114,7 +114,7 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst | |
} | ||
} else { | ||
self[key] = datepickerConfig[key] ? | ||
dateParser.fromTimezone(new Date(datepickerConfig[key]), ngModelOptions.timezone) : | ||
dateParser.fromTimezone(new Date(datepickerConfig[key]), ngModelOptions.getOption('timezone')) : | ||
null; | ||
} | ||
|
||
|
@@ -161,14 +161,24 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst | |
|
||
this.init = function(ngModelCtrl_) { | ||
ngModelCtrl = ngModelCtrl_; | ||
ngModelOptions = ngModelCtrl_.$options || | ||
$scope.datepickerOptions.ngModelOptions || | ||
datepickerConfig.ngModelOptions; | ||
|
||
// grab any timezone value based on precedence | ||
var timezone = ngModelCtrl_.$options.getOption('timezone') || | ||
($scope.datepickerOptions.ngModelOptions ? $scope.datepickerOptions.ngModelOptions.timezone : null) || | ||
(datepickerConfig.ngModelOptions ? datepickerConfig.ngModelOptions.timezone : null); | ||
|
||
// need to start with existing ModelOptions but also give it greatest precedence minus its default of null timezone | ||
ngModelOptions = ngModelCtrl_.$options | ||
.createChild(datepickerConfig.ngModelOptions) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This breaks compatibility with 1.5 I believe - we cannot have that for a minor version bump. Is there no way to made this compatible with both versions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
.createChild($scope.datepickerOptions.ngModelOptions) | ||
.createChild(ngModelCtrl_.$options) | ||
.createChild({timezone: timezone}); | ||
|
||
if ($scope.datepickerOptions.initDate) { | ||
self.activeDate = dateParser.fromTimezone($scope.datepickerOptions.initDate, ngModelOptions.timezone) || new Date(); | ||
self.activeDate = dateParser.fromTimezone($scope.datepickerOptions.initDate, ngModelOptions.getOption('timezone')) || new Date(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
$scope.$watch('datepickerOptions.initDate', function(initDate) { | ||
if (initDate && (ngModelCtrl.$isEmpty(ngModelCtrl.$modelValue) || ngModelCtrl.$invalid)) { | ||
self.activeDate = dateParser.fromTimezone(initDate, ngModelOptions.timezone); | ||
self.activeDate = dateParser.fromTimezone(initDate, ngModelOptions.getOption('timezone')); | ||
self.refreshView(); | ||
} | ||
}); | ||
|
@@ -178,8 +188,8 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst | |
|
||
var date = ngModelCtrl.$modelValue ? new Date(ngModelCtrl.$modelValue) : new Date(); | ||
this.activeDate = !isNaN(date) ? | ||
dateParser.fromTimezone(date, ngModelOptions.timezone) : | ||
dateParser.fromTimezone(new Date(), ngModelOptions.timezone); | ||
dateParser.fromTimezone(date, ngModelOptions.getOption('timezone')) : | ||
dateParser.fromTimezone(new Date(), ngModelOptions.getOption('timezone')); | ||
|
||
ngModelCtrl.$render = function() { | ||
self.render(); | ||
|
@@ -192,7 +202,7 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst | |
isValid = !isNaN(date); | ||
|
||
if (isValid) { | ||
this.activeDate = dateParser.fromTimezone(date, ngModelOptions.timezone); | ||
this.activeDate = dateParser.fromTimezone(date, ngModelOptions.getOption('timezone')); | ||
} else if (!$datepickerSuppressError) { | ||
$log.error('Datepicker directive: "ng-model" value must be a Date object'); | ||
} | ||
|
@@ -209,17 +219,17 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst | |
} | ||
|
||
var date = ngModelCtrl.$viewValue ? new Date(ngModelCtrl.$viewValue) : null; | ||
date = dateParser.fromTimezone(date, ngModelOptions.timezone); | ||
date = dateParser.fromTimezone(date, ngModelOptions.getOption('timezone')); | ||
ngModelCtrl.$setValidity('dateDisabled', !date || | ||
this.element && !this.isDisabled(date)); | ||
} | ||
}; | ||
|
||
this.createDateObject = function(date, format) { | ||
var model = ngModelCtrl.$viewValue ? new Date(ngModelCtrl.$viewValue) : null; | ||
model = dateParser.fromTimezone(model, ngModelOptions.timezone); | ||
model = dateParser.fromTimezone(model, ngModelOptions.getOption('timezone')); | ||
var today = new Date(); | ||
today = dateParser.fromTimezone(today, ngModelOptions.timezone); | ||
today = dateParser.fromTimezone(today, ngModelOptions.getOption('timezone')); | ||
var time = this.compare(date, today); | ||
var dt = { | ||
date: date, | ||
|
@@ -265,9 +275,9 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst | |
|
||
$scope.select = function(date) { | ||
if ($scope.datepickerMode === self.minMode) { | ||
var dt = ngModelCtrl.$viewValue ? dateParser.fromTimezone(new Date(ngModelCtrl.$viewValue), ngModelOptions.timezone) : new Date(0, 0, 0, 0, 0, 0, 0); | ||
var dt = ngModelCtrl.$viewValue ? dateParser.fromTimezone(new Date(ngModelCtrl.$viewValue), ngModelOptions.getOption('timezone')) : new Date(0, 0, 0, 0, 0, 0, 0); | ||
dt.setFullYear(date.getFullYear(), date.getMonth(), date.getDate()); | ||
dt = dateParser.toTimezone(dt, ngModelOptions.timezone); | ||
dt = dateParser.toTimezone(dt, ngModelOptions.getOption('timezone')); | ||
ngModelCtrl.$setViewValue(dt); | ||
ngModelCtrl.$render(); | ||
} else { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These can all probably be bumped to 1.6.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done