Francis Francis - 3 months ago 8
AngularJS Question

assign the value of input type email to another of type email angularjs

I am trying to assign an input field of type email to another in angularjs but it is not working. This is my attempt:

<div class="row-fluid">
<div class="control-group span12">
<label for="email">Email</label>
<input name="email" placeholder="" type="email" class="input-block-level" ng-model="email" required>
</div>
</div>
<div class="row-fluid">
<div class="control-group span12">
<label for="email">Confirm</label>
<input type="email" name="emailaccess" placeholder="" ng-model="{{id}}" class="input-block-level" required>
</div>
</div>


Please where is my wrong?

Answer

As angular js is two-way binding You need to use same ng-modal on both controls.

<div class="row-fluid">
        <div class="control-group span12">
            <label for="email">Email</label>
            <input name="email" placeholder="" type="email" class="input-block-level" ng-model="email" required>
        </div>
    </div>
    <div class="row-fluid">
        <div class="control-group span12">
            <label for="email">Confirm</label>
            <input type="email" name="emailaccess" placeholder="" ng-model="email" class="input-block-level" required>
        </div>
    </div>