我有textarea的问题。我在HTML中为它设置了一个默认值,但它没有可视化。这是一张图片:
http://postimg.org/image/lbn5mwugv/
此外,我使用此textarea将数据保存到mongodb,但即使使用默认值也不会保存,因为当没有输入任何内容时它被读为空((和之间有默认值)
它是由jade生成的:
.userContainer
.col-md-4
img.profileImg(src="{{ identity.currentUser.profilePic }}" , width="50px" , height="50px")
.profileData {{ identity.currentUser.firstName }} {{ identity.currentUser.lastName }}
textarea.post-form.form-control(rows="4" , placeholder="Share to world of LinkMe", ng-model='activity.body')
textarea.post-form.form-control#firstName(rows="4" , ng-model='activity.firstName') {{ identity.currentUser.firstName }}
textarea.post-form.form-control#lastName(rows="4" , ng-model='activity.lastName') {{ identity.currentUser.lastName }}
textarea.post-form.form-control#profilePic(rows="4" , ng-model='activity.profilePic') {{ identity.currentUser.profilePic }}
a#post-btn.btn.btn-primary.pull-right(ng-click="addpost(activity)", href="/") Link
br
br
br
ul.noListStyle
li(ng-repeat="post in activity | orderBy: '-date'")
.postBody {{ post.body }} on {{ post.date | date: 'dd MMM h:mm'}} from {{ post.firstName }} {{ post.lastName }}