Skip to content
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

fix(MatPaginatorIntl): Provide a provider if exists. #7895

Merged
merged 3 commits into from
Nov 2, 2017

Conversation

Jefiozie
Copy link
Contributor

@Jefiozie Jefiozie commented Oct 19, 2017

If there is already a MatPaginatorIntl provider that one. If not create a new instance.

@andrewseguin I hope this is the correct implementation. If not let me know I will change it.
Next to this shouldn't this also be implemented for sort-header-intl
cc: @jelbourn
Closes #7344

If there is already a MatPaginatorIntl provider that one
If not create a new instance.

Closes angular#7344
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 19, 2017
@Jefiozie
Copy link
Contributor Author

@andrewseguin the screenshot test failed but it looks like it is different because of the focus on the input. Don't know if I did this but I don't see how.

@Jefiozie
Copy link
Contributor Author

@andrewseguin or @jelbourn, Any idea when this pr will be reviewed? Happy to change things of needed.
Thanks.

@@ -46,3 +46,17 @@ export class MatPaginatorIntl {
return `${startIndex + 1} - ${endIndex} of ${length}`;
}
}

/** @docs-private */
export function MAT_PAGINATOR_INTL_PROVIDER_FACTORY(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just call the arg parentIntl

@@ -12,7 +12,7 @@ import {MatButtonModule} from '@angular/material/button';
import {MatSelectModule} from '@angular/material/select';
import {MatTooltipModule} from '@angular/material/tooltip';
import {MatPaginator} from './paginator';
import {MatPaginatorIntl} from './paginator-intl';
import { MAT_PAGINATOR_INTL_PROVIDER} from './paginator-intl';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omit space at beginning of import

@Jefiozie
Copy link
Contributor Author

@jelbourn just pushed a new commit with I believe the requested changes.

@@ -48,7 +48,7 @@ export class MatPaginatorIntl {
}

/** @docs-private */
export function MAT_PAGINATOR_INTL_PROVIDER_FACTORY(
export function parentIntl(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I wasn't totally clear. I meant the argument to the function (so that it fits on one line):

export function MAT_PAGINATOR_INTL_PROVIDER_FACTORY(parentIntl: MatPaginatorIntl) {
  return parentMatPaginatorIntl || new MatPaginatorIntl();
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, will make the change, just to be sure with parentMatPaginatorIntl you mean the parentIntl argument correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also did you see my first comment, should pattern also be implemented for the sort-header-intl

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Oct 23, 2017
@jelbourn
Copy link
Member

Feel free to send a similar PR for sorting

@andrewseguin andrewseguin merged commit 9a05ecd into angular:master Nov 2, 2017
crisbeto added a commit to crisbeto/material2 that referenced this pull request Sep 1, 2018
Along the same lines as angular#7988 and angular#7895. Fixes the consumer-provided `MatStepperIntl` instance not being picked up inside lazy-loaded modules.

Fixes angular#12904.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Paginator] Add app-wide configuration for MatPaginatorIntl
4 participants