0

I have a controller that is similar to:

var TheController = can.Control.extend({
    defaults: {
    field: undefined
},

"pluginName": "theControllerPlugin",
},
{
"init" : function(element, options) {
    field = options["fieldInOptions"];

Right now this field is acting essentially as a static variable. I would prefer it acted as an instance variable. Is this possible and what is the syntax in canJS?

ramblinjan
  • 6,578
  • 3
  • 30
  • 38
ford prefect
  • 7,096
  • 11
  • 56
  • 83

1 Answers1

2

The syntax is this.options.field, any default property can be accessed with this.options.defaultProperty.

Cherif BOUCHELAGHEM
  • 1,126
  • 2
  • 14
  • 21