Solved

AngularJS need default value in <input>

Posted on 2013-11-26
3
3,627 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 500 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBS script  to map network printers to all users. 3 66
allow link tag to be submit like form 15 60
Javascript Error 10 24
Psexec with Powershell to install critical patches 5 76
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

752 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