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

feat(module: checkbox&radio): ngModel&Onpush support #167

Merged
merged 4 commits into from
Dec 19, 2018

Conversation

fisherspy
Copy link
Collaborator

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Application (the showcase website) / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

[x] Yes
[ ] No

Checkbox & Radio Module support ngModel, so some of APIs will be modified. Please check docs for details.

Other information

@codecov
Copy link

codecov bot commented Dec 18, 2018

Codecov Report

Merging #167 into master will increase coverage by 0.04%.
The diff coverage is 90.43%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #167      +/-   ##
==========================================
+ Coverage   86.34%   86.38%   +0.04%     
==========================================
  Files         221      221              
  Lines        7081     7103      +22     
  Branches      990      986       -4     
==========================================
+ Hits         6114     6136      +22     
- Misses        570      571       +1     
+ Partials      397      396       -1
Impacted Files Coverage Δ
components/menu/sub-menu/sub-menu.component.ts 91.42% <100%> (+0.8%) ⬆️
components/radio/radio.component.ts 100% <100%> (ø) ⬆️
components/checkbox/agree-item.component.ts 100% <100%> (ø) ⬆️
components/menu/menu.module.ts 100% <100%> (ø) ⬆️
components/radio/radio.module.ts 100% <100%> (ø) ⬆️
components/checkbox/checkbox.component.ts 100% <100%> (ø) ⬆️
components/radio/radio-item-group.component.ts 77.5% <77.5%> (ø)
components/radio/radio-item.component.ts 87.5% <94.11%> (-6.25%) ⬇️
components/checkbox/checkbox-item.component.ts 91.66% <94.44%> (+3.43%) ⬆️
components/core/util/convert.ts
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b4af7c7...c618228. Read the comment docs.

Copy link
Contributor

@3fuyu 3fuyu left a comment

Choose a reason for hiding this comment

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

please follow one login one pr,split it and push more pr :)

checked: boolean = false;
private _disabled: boolean = false;

private _ngModelOnChange = Function.prototype;
Copy link
Contributor

Choose a reason for hiding this comment

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

suggest write:
private _ngModelOnChange: (checked: Boolean) => void = () => {};

private _disabled: boolean = false;

private _ngModelOnChange = Function.prototype;
private _ngModelOnTouched = Function.prototype;
Copy link
Contributor

Choose a reason for hiding this comment

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

suggest write:
private _ngModelOnTouched: (checked: Boolean) => void = () => {};

checked: boolean = false;
private _disabled: boolean = false;
private _ngModelOnChange = Function.prototype;
private _ngModelOnTouched = Function.prototype;
Copy link
Contributor

Choose a reason for hiding this comment

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

the same with up

@@ -3,15 +3,15 @@ import {
ViewEncapsulation,
Input,
Output,
EventEmitter,
EventEmitter, OnChanges, SimpleChanges
} from '@angular/core';

@Component({
selector: 'SubMenu, nzm-sub-menu',
templateUrl: './sub-menu.component.html',
encapsulation: ViewEncapsulation.None,
})
Copy link
Contributor

Choose a reason for hiding this comment

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

need onPush?


onChange: (value: RadioStatus) => {};
onTouched: () => {};

Copy link
Contributor

Choose a reason for hiding this comment

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

suggest unify style

@@ -0,0 +1 @@
<ng-content></ng-content>
Copy link
Contributor

Choose a reason for hiding this comment

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

add new line

@fisherspy fisherspy merged commit b1b4807 into NG-ZORRO:master Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants