简体   繁体   中英

knockoutjs observable array

I am trying to create a facebook wall-like application.

Is there a way that I can add entities to the top of array rather than at the bottom so that I can get a wall like appearance?

You can use observableArray.unshift to add values to the start of the array.

myObservableArray.unshift('Some new value') inserts a new item at the beginning of the array

You can read more about it in the observableArray documentation .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM