I am reading an application code that written dojo.
define(["dojo/ready", "dojo/_base/declare"], function(ready, declare) {
return declare("application.main", null, {
constructor: function(options) {
var _self = this;
this.options = {};
declare.safeMixin(_self.options, options);
}
addReportInAppButton: function() {
var _self = this;
if (_self.options.appName) {
}});
I confused about some points.
- in constructor function and addReportInAppButton used this keyword and assigned to _self property.
- Declare.safeMixin(_self.opt.ons, options)
options is an array like this { "appName":"xyz", "appId":"1141"}
I noticed that assigned this.options is using in addReportInAppButton function like this _self.oprions.appName,
How does this work? and is declare.safeMixin copiying object to this.options?