In angular 1.x, one-way databinding syntax was ::
I'm trying to pass an object down to a child component with one-time binding. The child needs to get the initial data from the parent, but the parent doesn't ever change the data and doesn't need to know if the child changed it.
<parent [child-data]="childData"/>
How can I one-time bind this?
I know this is old, but I stumbled upon this: ANGULAR CHANGE DETECTION EXPLAINED which basically says that as long as you use immutable inputs and observables (which might not be the case all the time, but it could be in some big tables with lots of bindings):
@Input
, then you got One time binding yeah I know it's for the whole component, not just for specific bindings though....This post: angular 2 one time binding seams to indicate the using ChangeDetectionStrategy.CheckOnce could be the solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With