سؤال

I have something like this:{{item.bla|| item.bla2}}

how can i put this in ng-model, i can't just do it like this:

input class="form-control" type="text" ng-model="{{item.bla || item.bla2}}"
هل كانت مفيدة؟

المحلول

Maybe this will help (assuming item is in scope):

<input class="form-control" type="text" ng-init="model= item.bla || item.bla2" 
          ng-model="model" />
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top