X Tutup
Skip to content

doc(LifecycleHooks): update API doc#4357

Closed
vicb wants to merge 1 commit intoangular:masterfrom
vicb:0924-lchooks
Closed

doc(LifecycleHooks): update API doc#4357
vicb wants to merge 1 commit intoangular:masterfrom
vicb:0924-lchooks

Conversation

@vicb
Copy link
Copy Markdown
Contributor

@vicb vicb commented Sep 24, 2015

first commit is #4337, second commit has the doc updates

@vicb vicb added comp: docs action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 24, 2015
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

OnInit, OnDestroy are not implemented (nor needed for the example).

@0x-r4bbit
Copy link
Copy Markdown
Contributor

I think I just realised that @gkalpak already mentioned most of the typos that I mentioned on the PR. Didn't want to comment just on the comment. Sorry for spamming

@vicb
Copy link
Copy Markdown
Contributor Author

vicb commented Sep 25, 2015

Thank you guys for the feedback, PTAL

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this directives --> the directive (?)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove

@IgorMinar
Copy link
Copy Markdown
Contributor

One change we should make everywhere is to at least in the first sentence always mention both directives and components (even though Component is subclass of Directive) because most users won't realize this connection.

Otherwise this looks quite good!

@vicb
Copy link
Copy Markdown
Contributor Author

vicb commented Sep 30, 2015

One change we should make everywhere is to at least in the first sentence always mention both directives and components (even though Component is subclass of Directive) because most users won't realize this connection.

We should have a convention that we use across the code base. Could we handle that a part of an other PR once we have decided ?

@vicb
Copy link
Copy Markdown
Contributor Author

vicb commented Sep 30, 2015

@IgorMinar Thanks for the review. Most of your feeback has been implemented, I've added comments otherwise. Please let me know if that's ok.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the only difference between this sentence the the sentence above is the the first one says when ("after") and the other says how often ("every time"). Otherwise the sentences are the same, so that's why I think that they should be merged into one.

@IgorMinar
Copy link
Copy Markdown
Contributor

replied to your comments.

wrt directive/component we can do that in a different pass/pr.

@vicb
Copy link
Copy Markdown
Contributor Author

vicb commented Sep 30, 2015

PR updated, PTAL.

@IgorMinar
Copy link
Copy Markdown
Contributor

I went over all of the first sentences for all of these hooks and I'm proposing the following changes (using code formatting to make visual diffing easier):

# OnChanges
- Implement this interface to get notified when any data-bound property of the directive changes.
+ Implement this interface to get notified when any data-bound property of your directive changes.

# OnInit
- Implement this interface to get notified when the directive or's data-bound properties have been initalized.
+ Implement this interface to execute custom initialization logic after your directive's data-bound properties have been initialized.

# DoCheck
- Implement this interface to override the default change detection algorithm for the directive.
+ Implement this interface to override the default change detection algorithm for your directive.

# OnDestroy
- Implement this interface to get notified when the directive is destroyed.
+ Implement this interface to get notified when your directive is destroyed.

# AfterContentInit
- Implement this interface to get notified when all of the content children have had their data-bound properties initialized.
+ Implement this interface to get notified when your directive's content has been fully initialized.

# AfterContentChecked
- Implement this interface to get notified each time the content children have been checked.
- Implement this interface to get notified after every check of your directive's content.

# AfterViewInit
- Implement this interface to get notified when all of the view children have had their data-bound properties initialized.
+ Implement this interface to get notified when your component's view has been fully initialized.

# AfterViewChecked
- Implement this interface to get notified each time the view children have been checked.
+ Implement this interface to get notified after every check of your component's view.

Sorry for all the back and forth but this api is important.

btw I'm not too happy with the "view" and "content" terminology used here as it's not consistent with the rest of the apis, but let's leave that for another discussion/pr.

@vicb
Copy link
Copy Markdown
Contributor Author

vicb commented Oct 1, 2015

Sorry for all the back and forth but this api is important.

No problem I love feedback ;)
Your proposals are valuable, I'll go ahead and implement it.

WRT "view" and "content", I do agree. This is something that we should agree at global level & document.

@vicb
Copy link
Copy Markdown
Contributor Author

vicb commented Oct 1, 2015

@IgorMinar As much as I love feedback, I hope you'll be fine with the latest version of this PR.

Thanks for your suggestions, all of them have been implemented

@IgorMinar
Copy link
Copy Markdown
Contributor

lgmt. go ahead and merge

@IgorMinar IgorMinar added pr_state: LGTM action: merge The PR is ready for merge by the caretaker labels Oct 1, 2015
@mary-poppins
Copy link
Copy Markdown

Merging PR #4357 on behalf of @IgorMinar to branch presubmit-IgorMinar-pr-4357.

@mary-poppins mary-poppins removed the action: merge The PR is ready for merge by the caretaker label Oct 1, 2015
@mary-poppins
Copy link
Copy Markdown

Merging PR #4357 on behalf of @vicb to branch presubmit-vicb-pr-4357.

@vicb vicb added the action: merge The PR is ready for merge by the caretaker label Oct 2, 2015
@mary-poppins mary-poppins removed the action: merge The PR is ready for merge by the caretaker label Oct 2, 2015
@vicb vicb closed this in a110ce9 Oct 2, 2015
@vicb vicb deleted the 0924-lchooks branch June 9, 2017 17:15
@angular-automatic-lock-bot
Copy link
Copy Markdown

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 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

X Tutup