0
如何在Angular 2中將文本分解爲我的textarea?爲每個值打破文本(換行)
我收到了顯示一些細節的組件。
<div class="panel panel-default">
<div class="panel-heading">Details</div>
<br>
<div class="panel-body">
<form action="" class="form-horizontal" *ngIf=alias>
<div class="form-group">
<label for="mail" class="col-sm-2 control-label">Mail: </label>
<div class="col-sm-9">
<p class="form-control">{{alias.name + '(at)' + alias.domain}}</p>
</div>
</div>
<div class="form-group">
<label for="recipients" class="col-sm-2 control-label">Recipients: </label>
<div class="col-sm-9">
<textarea class="form-control" row="4" col="50"> {{ alias.recipients }} <br></textarea>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-8">
<button type="submit" class="btn btn-outline-info" (click)="goBack()">Cancel</button>
</div>
</div>
</form>
</div>
</div>
我嘗試添加<br>
在textarea
但不工作。 我想是這樣的: 輸出:
alias.recipient1
alias.recipient2
alias.recipient3
相反alias.recipient1,alias.recipient2, alias.recipient3(現在我有這個)
謝謝你,就像一個魅力! –