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

Don't use ngModel in md-paginator #5717

Closed
shlomiassaf opened this issue Jul 13, 2017 · 3 comments · Fixed by #6080
Closed

Don't use ngModel in md-paginator #5717

shlomiassaf opened this issue Jul 13, 2017 · 3 comments · Fixed by #6080
Assignees

Comments

@shlomiassaf
Copy link
Contributor

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Material components should be form agnostic (template/reactive)

What is the current behavior?

md-paginator uses ngModel in its template

@crisbeto
Copy link
Member

I suppose the underlying issue here is that md-select doesn't have a way of setting the value without the forms module.

@shlomiassaf
Copy link
Contributor Author

Yes, that always seems strange to me, but I don't know the logic behind the design...

md-select should implement value accessor to support that?

This means that every complex component that composes other material components might run into this issue...

I don't think it can stay like that, it forces the developer to use template driven forms or at least import them just for that purpose...

crisbeto added a commit to crisbeto/material2 that referenced this issue Jul 19, 2017
Currently `md-select` can only really be used together with `@angular/forms` which is overkill for simple usages where it only sets a value (for example, the only reason the paginator module brings in the `FormsModule` is the select). These changes introduce the `value` two-way binding that can be used to read/write the value without using `ngModel` or a `formControl`. This also aligns it with the input module.

Relates to angular#5717.
andrewseguin pushed a commit that referenced this issue Jul 24, 2017
Currently `md-select` can only really be used together with `@angular/forms` which is overkill for simple usages where it only sets a value (for example, the only reason the paginator module brings in the `FormsModule` is the select). These changes introduce the `value` two-way binding that can be used to read/write the value without using `ngModel` or a `formControl`. This also aligns it with the input module.

Relates to #5717.
andrewseguin pushed a commit that referenced this issue Jul 25, 2017
Currently `md-select` can only really be used together with `@angular/forms` which is overkill for simple usages where it only sets a value (for example, the only reason the paginator module brings in the `FormsModule` is the select). These changes introduce the `value` two-way binding that can be used to read/write the value without using `ngModel` or a `formControl`. This also aligns it with the input module.

Relates to #5717.
andrewseguin pushed a commit that referenced this issue Jul 25, 2017
* feat(select): support basic usage without @angular/forms

Currently `md-select` can only really be used together with `@angular/forms` which is overkill for simple usages where it only sets a value (for example, the only reason the paginator module brings in the `FormsModule` is the select). These changes introduce the `value` two-way binding that can be used to read/write the value without using `ngModel` or a `formControl`. This also aligns it with the input module.

Relates to #5717.

* chore: add demo
@crisbeto crisbeto self-assigned this Jul 26, 2017
crisbeto added a commit to crisbeto/material2 that referenced this issue Jul 27, 2017
Since it's now possible to use `md-select` without `ngModel`, we can remove the dependency on `@angular/forms` from the paginator.

Fixes angular#5717.
tinayuangao pushed a commit that referenced this issue Jul 31, 2017
Since it's now possible to use `md-select` without `ngModel`, we can remove the dependency on `@angular/forms` from the paginator.

Fixes #5717.
tinayuangao pushed a commit that referenced this issue Aug 1, 2017
Since it's now possible to use `md-select` without `ngModel`, we can remove the dependency on `@angular/forms` from the paginator.

Fixes #5717.
crisbeto added a commit to crisbeto/material2 that referenced this issue Aug 1, 2017
Since it's now possible to use `md-select` without `ngModel`, we can remove the dependency on `@angular/forms` from the paginator.

Fixes angular#5717.
tinayuangao pushed a commit that referenced this issue Aug 2, 2017
Since it's now possible to use `md-select` without `ngModel`, we can remove the dependency on `@angular/forms` from the paginator.

Fixes #5717.
@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 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants