Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Support one time bindings in component signature #16173

@asulaiman

Description

@asulaiman

I'm submitting a ...

  • bug report
  • feature request
  • other (Please do not submit support requests here (see above))

Current behavior:
Currently the only way to define one time bindings is in the parent template which defines the component itself.

<my-component item="::someBinding"></my-component>

At the moment if a component is designed to support a binding which should be one time everytime, we need to add the one-time binding :: notation to the binding attribute each time the component is used.

Expected / new behavior:
In the component definition, provide an :: binding type. So the above example if it was supported on the component level would see the component defined as follows:

angular.module('myApp').component('myComponent', { templateUrl: 'template.html', bindings: { someBinding: '<::' } });

Consequently usage of the component would then be:
<my-component item="someBinding"></my-component>

Minimal reproduction of the problem with instructions:
Basically if i have a component with a one way binding which would/should use one-time binding, i do not want to define the one time binding everytime on the parent template level. This would also enforce the usage of one time-binding for this particular binding on the component.

AngularJS version: 1.6.5
Browser: all

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions