Update viewmodel.js

Added function as property argument