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

Support protected for input(), output(), and model(). #54681

Open
omansak opened this issue Mar 3, 2024 · 3 comments
Open

Support protected for input(), output(), and model(). #54681

omansak opened this issue Mar 3, 2024 · 3 comments
Labels
area: core Issues related to the framework runtime cross-cutting: signals
Milestone

Comments

@omansak
Copy link

omansak commented Mar 3, 2024

Description

Hello;
In Angular 17, signals are awesome. Now , I use signal, input and model in everywhere.
model signal has both of variable and input properties. If we use with public then it would be a component parameter. If we use with protected then it wouldn't as an input. Can we add a option (like as public model = model<string>.protected()) for no ìnput or output parameter. Sometimes we needs access from other class (with directive, or dynamic component createComponent) but we wants not input or output

Proposed solution

public model = model.protected<string>() -> Only two-way binding
public model = model.protectedInput<string>() -> two-way binding + @input()
public model = model.protectedOutput<string>() -> two-way binding + @output()

@omansak omansak changed the title Add option to model signal without input Add a option to model signal without input Mar 3, 2024
@JeanMeche
Copy link
Member

Writable signals are model without inputs (and outputs).

Are you looks for a model that does only outputs ?

@JeanMeche JeanMeche added area: core Issues related to the framework runtime cross-cutting: signals labels Mar 3, 2024
@ngbot ngbot bot added this to the needsTriage milestone Mar 3, 2024
@omansak
Copy link
Author

omansak commented Mar 3, 2024

I just want use model for two-way binding without both of input or output like as public varilable

@omansak omansak changed the title Add a option to model signal without input Add a option to model signal without input or output Mar 3, 2024
@alxhub alxhub changed the title Add a option to model signal without input or output Support protected for input(), output(), and model(). Mar 4, 2024
@omansak
Copy link
Author

omansak commented Mar 25, 2024

any progress ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues related to the framework runtime cross-cutting: signals
Projects
None yet
Development

No branches or pull requests

2 participants