Skip to content

(Feature Request) Action wrapper in template #143

@drowhunter

Description

@drowhunter

So in mobx you can wrap anythin in an action wrapper , since actions are needed to modify state.
I have the following code

<input [(ngModel)]="mystore.foo>

since its a two way binding in strict mode it complains

what I am wondering is could you add a feature so that i could do this.

<input [(ngModel)]="action(() => myStore.foo)

I'm aware of the workaround to this.
`<input [ngModel]="myStore.foo" (ngModelChange)="setMyStore($event)">/input>

setMyStore(val:string){
this.myStore.setFoo(val) //action for setting
}

Is there a feature to be able to do an in-template action wrapper

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions