顶啊
<script>
App = Ember.Application.create();
App.myArray= Ember.Object.extend({
array: [],
myLen: function(){
return this.get(*array*).length+3
}.property(*array*),
show: function(){
var str ="0,1,2"
for(var i=0;i<this.get(*array*).length;i++){
str = str+","+this.get(*array*)[i]
}
alert("the length of the array is " + this.get(*myLen*))
alert(str)
}
})
var s= App.myArray.create()
s.show()
s.array= new Array()
s.array[0]="ak"
s.array[1]="4y"
s.show()
</script>
<script>
App = Ember.Application.create();
App.myArray= Ember.Object.extend({
array: [],
myLen: function(){
return this.get(*array*).length+3
}.property(*array*),
show: function(){
var str ="0,1,2"
for(var i=0;i<this.get(*array*).length;i++){
str = str+","+this.get(*array*)[i]
}
alert("the length of the array is " + this.get(*myLen*))
alert(str)
}
})
var s= App.myArray.create()
s.show()
s.array= new Array()
s.array[0]="ak"
s.array[1]="4y"
s.show()
</script>













