I'm trying to set the default value via ng-model in a textarea. The content came from JSON
it would be something like this
$scope.message = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consectetur, provident!\n\nLorem ipsum dolor sit amet, consectetur adipisicing elit. Consectetur, provident! http://drive.google.com/";
But it become blank in the textarea:
<ion-view title="Tab Title">
<ion-content class="padding">
<form name="myForm" novalidate><textarea type="text" class="textarea" placeholder="" ng-model="message" ng-maxlength="150" ng-required="true" ng-trim="false" ng-bind-html="message"></textarea>
<div ng-hide="feedback === 1">
<button class="button button-block button-assertive" ng-click="activate()" ng-disabled="myForm.$invalid || sendingData">
<i class="ion-alert-circled"></i> Go
</button>
</form>
</ion-content>
</ion-view>
Anyway to get around this?
btw, I'm doing the app with ionic framework.
The problem in this case is very easy. There are 2 bugs in your plunker:
';'
at the end to make it valid json.ng-maxlength
, or leave it just as maxlength
.Sad that there is no warning or error from Angular at all when trying to set a too long text on a textfield with maxlength defined..