Update view-generator.js

convertet from constructor to object