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.

ng-model doesn't work with ng-if #6038

@adamkdean

Description

@adamkdean

If you have something bound with ng-model but you also have ng-if on that element, the binding doesn't seem to work.

With ng-if:

<p ng-init="test='hello'">
    <input type="text" ng-if="test" ng-model="test">
    <span ng-bind="test"></span>
</p>

Without ng-if:

<p ng-init="test='hello'">
    <input type="text" ng-model="test">
    <span ng-bind="test"></span>
</p>

Example plunkr:

http://plnkr.co/edit/cRfXlpKWtgnE0D6HMVGn?p=preview

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