Is AngularJS value calculated incorrectly?

I have an extremely simple example: http://jsfiddle.net/daylight/hqHSr/

To try, just go to the violin and click the [Add Item] button to add a few lines.

Then check the box next to any item and you will see something similar to the following: AngularBugStep1

Problem: displays only the digital part The problem is that the value should display the entire line shown in the line. In the example, this means that it should display: 86884-LLMUL. Please note that it only displays a numerical value.

, , = "". , model (simpleItem), , . JavaScript :

  function simpleItem(id) {
        this.id = id;
    }

, , , ( ).

, simpleItem:

currentItem.id = getRandom(100000).toString() + "-" + getRandomLetters(5).toUpperCase();

, 5 . .

, . - , , X, , . , : 2

currentItem.id = getRandom(100000).toString() + "X" + getRandomLetters(5).toUpperCase();

enter image description here

, , Dev Tools , , Angular , [ ]. : enter image description here

? ? HTML :

ng-init="itemId ={{l.id.toString()}}" 

ng-init="itemId ='{{l.id.toString()}}'" 

, , , ​​ , : 3

Angular: "" "-"? , Angular, , , ( ), . , , X, Angular .

, - , Angular Dev Tools . enter image description here

Angular ? Angular? , INPUT , JavaScript var - . - ?

( )?

, , , - a * . , , - .

enter image description here

+4
4

ng-init

ng-init="itemId =l.id.toString()"

init , . http://docs.angularjs.org/api/ng.directive:ngInit

+2

. Angular , , ng-init scope.$eval . , input .

, Angular , quotes, , class="my-class {{dynamic-class}}".

+3

, Angular . , Angular , javascript, {{}}. , , ( ):

ng-init = "itemId = {{l.id.toString()}}"

-, , ", , " l.id.toString(). . .

?

ng-init itemId={{undefined===undefined}}, ? ( "true" ).

: (undefined === undefined ) ng-init itemId={{'undefined===undefined'}}; true .

+2

ng-init angular. . :

ng-init="itemId=l.id" ng-click="checkBoxClicked(itemId)"
+1

All Articles