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(core): add support for @Property and @Event decorators #3992

Closed

Conversation

vsavkin
Copy link
Contributor

@vsavkin vsavkin commented Sep 4, 2015

Example:

@Directive({selector: 'my-selector'})
class MyDirective {
  @Property() prop;
  @Property('el-prop') prop2;
  @Event() event;
  @Event('el-event') event2;
}

Example:

@directive({selector: 'my-selector'})
class MyDirective {
  @Property() prop;
  @Property('el-prop') prop2;
  @event() event;
  @event('el-event') event2;
}
@vsavkin vsavkin added comp: core effort2: days action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 4, 2015
@vsavkin vsavkin added this to the alpha-38 milestone Sep 4, 2015
@PatrickJS
Copy link
Member

can we also get an Observable event?
@ObservableEvent('mouseover') mouseover;

update: nvm I see it's possible
@Event('elEvent') event = new EventEmitter();

@mhevery mhevery added pr_state: LGTM and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 4, 2015
@mhevery mhevery assigned vsavkin and unassigned mhevery Sep 4, 2015
@vsavkin vsavkin added the action: merge The PR is ready for merge by the caretaker label Sep 4, 2015
@mary-poppins
Copy link

Merging PR #3992 on behalf of @vsavkin to branch presubmit-vsavkin-pr-3992.

@mary-poppins mary-poppins removed the action: merge The PR is ready for merge by the caretaker label Sep 4, 2015
@vsavkin vsavkin closed this in 896add7 Sep 4, 2015
@pkozlowski-opensource
Copy link
Member

Yeeeeeesssssss!!! Thnx @mhevery @vsavkin

@0x-r4bbit
Copy link
Contributor

This is really syntactic sugar right? We will still be able to use properties: [] and EventEmitter constructor?

@thelgevold
Copy link
Contributor

I like this idea and think it's an improvement over the current properties:[] syntax. Seems more clear to me.

@0x-r4bbit
Copy link
Contributor

@thelgevold yes, but if you'd write that in ES5, creating an annotation by hand everytime you wanna add a property is kinda huge.

@thelgevold
Copy link
Contributor

@PascalPrecht Yes, I think that is a good point. I am guessing they will still support the current properties:[] along side this new idea. Probably just a new short notation like you pointed out above.

@gionkunz
Copy link
Contributor

Simply awesome guys! 👍

@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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants