Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

AngularJS need default value in <input>

Posted on 2013-11-26
3
Medium Priority
?
4,050 Views
Last Modified: 2016-09-25
I am a newbie to AngularJS and JavaScript

I have two <span> tags that toggle on show and hide.  When the toggle goes to show for the input I need the value in {{ user.LastName }} to be the default value in the input.  I tried <input value='{{ user.LastName }}' .....> with no success

 <tr ng-repeat="user in weeklyReportUsers">
....
....
....
<td class="weeklyLastName">
      <span ng-hide="editedItems[user.LastName]">{{ user.LastName }}</span>
      <span ng-show="editedItems[user.LastName]">
            <input class="form-control" type="text" ng-model="user.wklyLastName" />
      </span>
</td>        
....
....
....
</tr>
0
Comment
Question by:Charles Baldo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 39677629
What about :
<input class="form-control" type="text" ng-init="user.wklyLastName=user.LastName" ng-model="user.wklyLastName" />
0
 

Author Closing Comment

by:Charles Baldo
ID: 39678182
Thanks a ton
0
 

Expert Comment

by:maga lakshmi
ID: 41815365
hi
          maha
0

Featured Post

Application Discovery Service in AWS

In the era of the cloud, customers migrating away from their existing on-premise infrastructure. This requires lots of planning, strategies, and effort to identify their existing resources and determine how best to migrate.  Datacenter migrations happen in four phases -

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question