Recently, it is very simple to get a thing.
Do not know why there is a hole, two-way binding, but when there is an array of empty, it will not send an empty arrays, but not send.
This is the pit daddy. Cause it is always deleted.
When processed, the "[]" string is sent when the validation is null.
Success.
But when Avalon binds ms-repeat, it can only bind arrays and objects.
So after getting to it operation. is converted into an empty array.
But it's never been successful.
Always be prompted to bind only arrays or objects.
Reference to other examples, there is no difference.
This is the same operation. But it just doesn't work.
Today when debugging, suddenly found that there was a problem in the conversion.
Then switch directly to the object referenced by the operation, instead of assigning my newly defined object after the assignment.
Because the value assigned to it is a string, not an object.
"Although in JS, all of them are object = =. But it's a bit of a pit, it seems. 】
So there's no such thing as a mistake.
Originally, the base type was passed without a reference. Arrays, objects, and functions are available.
have been confused before, JS when is the value of the transfer, when the reference is passed.
Reference: Http://blog.sina.com.cn/s/blog_52132c010102wa81.html feel comments relatively concise
5 Basic data types: number/string/null/boolean/undefined
Reference type: Array/function/object
function Chainstore ()
{
var store1= ' Nike China ';
var store2=store1;
Store1= ' Nike U.S.A. ';
alert (Store2); Nike China
}
Chainstore ();
The reference and re-assignment of the base data type is equal to the fact that a value is copied, that is, there are two blocks in the memory, and the same two values are saved respectively. var store1= ' Nike China '; The Nike China was assigned to Store1. and Var Store2=store1; Also opened a new memory address, the Nike China Copy, copy instead of assignment, to the Store2. Now, there are two areas in memory: Store1 and Store2, all of which are Nike China. Well, that's a good idea. Therefore, Store1 casually modified, store2 or remain unchanged.
The reference type, for example: function Chainstore () {
var store1=[' Nike China ';
var store2=store1;
Alert (store2[0]); Nike China
Store1[0]= ' Nike U.S.A. ';
Alert (store2[0]); Nike U.S.A.
}
Chainstore ();
Why is the output Store2 two times different? Because: this is an array, which belongs to the reference type. Although there are store1 and store2 two variables, but in memory (the reference address) is the same address, this knowledge of the pointer concept of the reunion is very well understood. So the first time Var store2=store1; In fact, only the reference address to the Store2. So two stores share the same "Nike China", and when the Store1 is modified, the content they share changes (because there's one thing, not each one), Led to the Store2 output also changed, became "Nike U.S.A."
Above, simple example reference type, and basic data type value Pass reference pass JS
About JS value passing and reference passing