Updated example for resource.js

It was wrong unfortunatelly :(