javascript - Angular model doesn't update with space -


When an angular model is bound to any input, angular connects the space, does not update the value. Even if the model is seen, the value still does not update.

I created one to display this issue. Type a string, and notice the value in the bound spans update. However, add a location at the end of the string and the price is not updated. Is there a way to see the applet in the empty space?

The specific code is:

View

  & lt; Div ng-controller = "MyCtrl" & gt; & Lt; Input data-ng-model = "input value" & gt; & Lt; P & gt; This value is: ---- & lt; Span data-ng-bind = "inputValue" & gt; & Lt; / Span & gt; ---- & lt; / P & gt; & Lt; / Div & gt;  

Controller

  function myCtrl ($ scope) {$ scope.inputValue = 'Superhero'; });    

You have to set ngTrim to the wrong. By default the angle is set to true, which trim the white space in the input boxes:

    

Ingredient:

Docs:


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -