This repository was 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
fix(carousel): re-enable deprecated directives #4527
Closed
Closed
Changes from all commits
Commits
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -340,7 +340,6 @@ describe('carousel', function() { | |
}); | ||
|
||
describe('slide order', function() { | ||
|
||
beforeEach(function() { | ||
scope.slides = [ | ||
{active:false,content:'one', id:1}, | ||
|
@@ -551,27 +550,30 @@ describe('carousel deprecation', function() { | |
spyOn($log, 'warn'); | ||
|
||
var element = '<carousel interval="interval" no-transition="true" no-pause="nopause">' + | ||
'<slide ng-repeat="slide in slides" active="slide.active">' + | ||
'{{slide.content}}' + | ||
'</slide>' + | ||
'</carousel>'; | ||
'<slide ng-repeat="slide in slides" active="slide.active">' + | ||
'{{slide.content}}' + | ||
'</slide>' + | ||
'</carousel>'; | ||
element = $compile(element)($rootScope); | ||
$rootScope.$digest(); | ||
|
||
expect($log.warn.calls.count()).toBe(1); | ||
expect($log.warn.calls.argsFor(0)).toEqual(['carousel is now deprecated. Use uib-carousel instead.']); | ||
expect($log.warn.calls.count()).toBe(2); | ||
expect($log.warn.calls.argsFor(0)).toEqual(['CarouselController is now deprecated. Use UibCarouselController instead.']); | ||
expect($log.warn.calls.argsFor(1)).toEqual(['carousel is now deprecated. Use uib-carousel instead.']); | ||
})); | ||
|
||
it('should give warning by default for slider', inject(function($compile, $log, $rootScope) { | ||
spyOn($log, 'warn'); | ||
|
||
var element = '<carousel interval="interval" no-transition="true" no-pause="nopause">' + | ||
'<slide></slide>' + | ||
'</carousel>'; | ||
'<slide></slide>' + | ||
'</carousel>'; | ||
element = $compile(element)($rootScope); | ||
$rootScope.$digest(); | ||
|
||
expect($log.warn.calls.count()).toBe(2); | ||
expect($log.warn.calls.argsFor(0)).toEqual(['slide is now deprecated. Use uib-slide instead.']); | ||
expect($log.warn.calls.count()).toBe(3); | ||
expect($log.warn.calls.argsFor(0)).toEqual(['CarouselController is now deprecated. Use UibCarouselController instead.']); | ||
expect($log.warn.calls.argsFor(1)).toEqual(['slide is now deprecated. Use uib-slide instead.']); | ||
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. Check all messages. |
||
expect($log.warn.calls.argsFor(2)).toEqual(['carousel is now deprecated. Use uib-carousel instead.']); | ||
})); | ||
}); |
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.
I don't think this is needed? I don't see any usage of
scope.carousel
.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.
We started to add this option to some directives to expose the controller to the template using
controllerAs
. It is not something I would add personally, but there it is.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.
Hm.. okay, sounds like a separate feature though. But okay.
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.
Excuse me Chris, but after a couple of months away of the project, there is lots of stuff being done and I am afraid that you're barking to the wrong tree. I totally understand that.
Imagine that by mistake, we make a commit where we delete an entire directive. Then we want to create another PR to put back the content we deleted. We are simply doing a chore to put it back like it was before. We are not creating multiple PRs with all the features we deleted one by one. We are just restoring something that was there in a first place.
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.
You're right. It was added as a feature in #4131, I wasn't aware of that.