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

test(ivy): add canonical lifecycle example #21793

Closed
wants to merge 2 commits into from
Closed

Conversation

kara
Copy link
Contributor

@kara kara commented Jan 26, 2018

Adds an example of lifecycle hooks to the canonical spec. Also flips r() calls for content children in lifecycle spec (it was left over from a previous implementation).

cc @jelbourn

@kara kara requested a review from mhevery January 26, 2018 03:21
@kara kara added action: review The PR is still awaiting reviews from at least one requested reviewer target: major This PR is targeted for the next major release comp: ivy labels Jan 26, 2018
@mhevery mhevery removed the action: review The PR is still awaiting reviews from at least one requested reviewer label Jan 26, 2018
@mary-poppins
Copy link

You can preview 3954c64 at https://pr21793-3954c64.ngbuilds.io/.

@kara kara added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jan 26, 2018
@mary-poppins
Copy link

You can preview 0135b3f at https://pr21793-0135b3f.ngbuilds.io/.

@mhevery mhevery added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jan 26, 2018

@Component({selector: 'lifecycle-comp', template: ``})
class LifecycleComp {
@Input() nameMin: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

@Input('name')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

static ngComponentDef = r3.defineComponent({
type: LifecycleComp,
tag: 'lifecycle-comp',
factory: () => new LifecycleComp(),
Copy link
Contributor

Choose a reason for hiding this comment

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

factory: function LifecycleComp_Factory() { return new LifecycleComp(); },

This is optional (since this is non-normative) but would be more consistent.

type: LifecycleComp,
tag: 'lifecycle-comp',
factory: () => new LifecycleComp(),
template: function(ctx: any, cm: boolean) {},
Copy link
Contributor

Choose a reason for hiding this comment

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

template: function LifecycleComp_Template(ctx: LifecycleComp, cm: boolean) {}

This is optional (since this is non-normative) but would be more consistent.

name1 = '1';
name2 = '2';

static ngComponentDef = r3.defineComponent({
Copy link
Contributor

Choose a reason for hiding this comment

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

Add // NORMATIVE above this declaration

}
});
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Add \\ /NORMANTIVE

static ngComponentDef = r3.defineComponent({
type: SimpleLayout,
tag: 'simple-layout',
factory: () => new SimpleLayout(),
Copy link
Contributor

Choose a reason for hiding this comment

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

factory SimpleLayout_Factory() { return new SimpleLayout(); }

type: SimpleLayout,
tag: 'simple-layout',
factory: () => new SimpleLayout(),
template: function(ctx: any, cm: boolean) {
Copy link
Contributor

Choose a reason for hiding this comment

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

function SimpleLayout_Template(ctx: SimpleLayout, cm: boolean) {

static ngComponentDef = r3.defineComponent({
type: SimpleLayout,
tag: 'simple-layout',
factory: () => simpleLayout = new SimpleLayout(),
Copy link
Contributor

@chuckjaz chuckjaz Jan 26, 2018

Choose a reason for hiding this comment

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

factory: function SimpleLayout_Factory() { return new SimpleLayout(); }

type: SimpleLayout,
tag: 'simple-layout',
factory: () => simpleLayout = new SimpleLayout(),
template: function(ctx: any, cm: boolean) {
Copy link
Contributor

@chuckjaz chuckjaz Jan 26, 2018

Choose a reason for hiding this comment

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

template: function SimpleLayout_Template(ctx: SimpleLayout, cm: boolean) {

@jasonaden jasonaden closed this in d3d3f71 Jan 26, 2018
jasonaden pushed a commit that referenced this pull request Jan 26, 2018
chuckjaz added a commit to chuckjaz/angular that referenced this pull request Jan 29, 2018
Implement the lifecycle pattern defined in angular#21793
chuckjaz added a commit to chuckjaz/angular that referenced this pull request Jan 31, 2018
Implement the lifecycle pattern defined in angular#21793
alxhub pushed a commit that referenced this pull request Feb 2, 2018
Implement the lifecycle pattern defined in #21793

PR Close #21865
jbogarthyde pushed a commit to jbogarthyde/angular that referenced this pull request Feb 23, 2018
jbogarthyde pushed a commit to jbogarthyde/angular that referenced this pull request Feb 23, 2018
jbogarthyde pushed a commit to jbogarthyde/angular that referenced this pull request Feb 23, 2018
Implement the lifecycle pattern defined in angular#21793

PR Close angular#21865
leo6104 pushed a commit to leo6104/angular that referenced this pull request Mar 25, 2018
leo6104 pushed a commit to leo6104/angular that referenced this pull request Mar 25, 2018
leo6104 pushed a commit to leo6104/angular that referenced this pull request Mar 25, 2018
Implement the lifecycle pattern defined in angular#21793

PR Close angular#21865
@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 13, 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 target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants