javascript - this.own not defined in Dojo -


I am trying to create singleton class in Dojo with a method called loadsth. There I want to run it. Inside a foreach loop However, when I run this code then it says

  typeError: this is not a function.  

I looked in dojo docs and scripts and there It is said that the method is a part of "self-destructive" destruction. But though this is included, it does not work I tried this situation at // @ 1 and // @ 2 I really needed the status // @ 2, but wanted to make sure that the foreshop loop was " "Not hidden. So I tried // @ 1 but it also does not work properly.

  define ([dojo / _base / declare "," dijit / destroyable "], function (declare, destroyable) {Var singletonclass = declared (" some class ", blank) , {_registerdPropertyGrids: [], _resourceNode: "", / * * Uses this method to register a property grid * * Provide the properties that should be shown in that grid. * / RegisterWidget: function (widgetName, propertyGridWidget } {Console.log (widgetName); this._registerdPropertyGrids.push ({widgetName, propertyGridWidget});}, / * * sets the resource node for this widget. * / SetResourceNode: functions Ion (resourcenode) {this._resourceNode = resourceNode;}, / * * loads sth. * / LoadSth: function () {console.log ("load"); // var deferred = this.own (...) [ 0]; // 1 This._registerdPropertyGrids.for each (function (index, index, array) {console.log ('_ registerdPropertyGrids [' + + Index '' = '+ element.widgetName); Var deferred = this.own (...) [0]; // @ 2}, this);}}); if (! _instance) {var_instance = new singletonclass (); } Return _instance; });  

I think it has some work with the implementation of a class.

So my real question is why is it said that this is it. Do I have a "defining" dependency list in the list of delicate / destructible?

You have delinquent / redundant listed as a dependency but you Actually your declared constructor is not expanding, and as a result, your prototype does not have own .

Instead of declaring ("...", blank, {, you want to declare (destroyer, { (where Vandalable is changing empty ).

Note:

  • String argument has been removed to declare because it A global name populates the location, which is disappointed with the AMD. <
  • I change the deleteable to deleteable I recommend the General Conference Construct For issues advises to start with a capital letter.

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -