javascript - redefine ng-model using ng-if -


Then I have a kind of forward that users can choose options after typing in the form if search data exists , Then the details of the data are automatically filled in text, however, if search data is not present, the details box is automatically filled with search data, which is what I do not want because it is an empty string, because it exists Not in.

  & lt; Input type = "text" required class = "formahead-regulated =" incorrect as treatment.service for treating "form control form control model" ng model = "newTreatment.async_selected_treatment" typeahead = "treatment searchTreatments ($ viewValue) "Type-based-selection =" search treatment ($ item) "focus =" true "placeholder =" CPT code "& gt; & Lt; Text area class = "form control required form control modal" rows = "3" ng-if = "newTreatment.async_selected_treatment.id == 'null'" ng model = "newTreatment.async_selected_treatment.description" placeholder = "add a description" & Gt; & Lt; / Textarea & gt;   

I wrote NG-but it was not intended. I basically need to check, then

  newTreatment.async_selected_treatment.id   

is null (because it does not exist in backend) Then I need

  newTreatment.async_selected_treatment.description   

to return nothing

Reflections I'm open to other Paintings Tips / Suggestions

to deal with this issue

 enter image details here do not work  Enter image details here

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -