Int*_*eep 8 html javascript angularjs
如何在没有ng-model首字母的情况下设置输入值.我不想改变模型值本身.输入内容没有第一个字母.
<input type="text" ng-model="myVal" >
Run Code Online (Sandbox Code Playgroud)
和js
$scope.myVal = 'Hello';
Run Code Online (Sandbox Code Playgroud)
通缉结果:ello
小智 10
假设您不想使用双向数据绑定,则可以使用值而不是ng-model
<input type="text" value="{{myVal.substr(1)}}" >
Run Code Online (Sandbox Code Playgroud)
如果你确实想要双向数据绑定,那么在模型语句中使用substr是没有意义的.